Browse Source

add vob as an video/mpeg

sort listings

add extension to title, it useful for understanding capabilities..

[git-p4: depot-paths = "//depot/": change = 745]
replace/4e84fdb41ea781c7a8f872baa423e8b3be4045a7
John-Mark Gurney 19 years ago
parent
commit
38e086bbe8
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      pymediaserv

+ 5
- 3
pymediaserv View File

@@ -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:


Loading…
Cancel
Save