|
|
@@ -83,14 +83,16 @@ medianode.contentTypes.update( { |
|
|
|
#'.mp4': 'video/mp4', |
|
|
|
'.mp4': 'video/mpeg', |
|
|
|
'.ogm': 'application/ogg', |
|
|
|
'.vob': 'video/mpeg', |
|
|
|
}) |
|
|
|
root.putChild('media', medianode) |
|
|
|
|
|
|
|
# Set up media files |
|
|
|
def addFSPath(parent, title, dpath): |
|
|
|
folder = cds.addContainer(parent, title, klass = StorageFolder) |
|
|
|
log.msg('title: %s, dpath: %s' % (title, dpath)) |
|
|
|
for i in os.listdir(dpath): |
|
|
|
dlist = os.listdir(dpath) |
|
|
|
dlist.sort() |
|
|
|
for i in dlist: |
|
|
|
fpath = os.path.join(dpath, i) |
|
|
|
try: |
|
|
|
fn, ext = os.path.splitext(i) |
|
|
@@ -114,7 +116,7 @@ def addFSPath(parent, title, dpath): |
|
|
|
else: |
|
|
|
raise KeyError, 'no item for mt: %s' % mt |
|
|
|
|
|
|
|
item = cds.addItem(folder, klass, fn) |
|
|
|
item = cds.addItem(folder, klass, i) |
|
|
|
cds[item].res = Resource('%s%s' % (urlbase, fpath), 'http-get:*:%s:*' % mt) |
|
|
|
cds[item].res.size = os.path.getsize(fpath) |
|
|
|
except KeyError: |
|
|
|