|
|
@@ -13,7 +13,7 @@ import os |
|
|
|
import sets |
|
|
|
import stat |
|
|
|
|
|
|
|
from DIDLLite import Container, StorageFolder, Item, VideoItem, AudioItem, TextItem, ImageItem, Resource |
|
|
|
from DIDLLite import Container, StorageFolder, Item, VideoItem, AudioItem, TextItem, ImageItem, Resource, ResourceList |
|
|
|
from twisted.web import resource, server, static |
|
|
|
from twisted.python import log |
|
|
|
from twisted.internet import abstract, interfaces, process, protocol, reactor |
|
|
@@ -204,11 +204,15 @@ class FSItem(FSObject, Item): |
|
|
|
|
|
|
|
def doUpdate(self): |
|
|
|
#print 'FSItem doUpdate:', `self` |
|
|
|
self.res = Resource(self.url, 'http-get:*:%s:*' % self.mimetype) |
|
|
|
self.res.size = os.path.getsize(self.FSpath) |
|
|
|
self.res = [ self.res ] |
|
|
|
self.res.append(Resource(self.url + '/mpeg2', 'http-get:*:%s:*' % 'video/mpeg')) |
|
|
|
self.res.append(Resource(self.url + '/xvid', 'http-get:*:%s:*' % 'video/x-msvideo')) |
|
|
|
self.res = ResourceList() |
|
|
|
r = Resource(self.url, 'http-get:*:%s:*' % self.mimetype) |
|
|
|
r.size = os.path.getsize(self.FSpath) |
|
|
|
self.res.append(r) |
|
|
|
if self.mimetype.split('/', 1)[0] == 'video': |
|
|
|
self.res.append(Resource(self.url + '/mpeg2', |
|
|
|
'http-get:*:%s:*' % 'video/mpeg')) |
|
|
|
self.res.append(Resource(self.url + '/xvid', |
|
|
|
'http-get:*:%s:*' % 'video/x-msvideo')) |
|
|
|
Item.doUpdate(self) |
|
|
|
|
|
|
|
def ignoreFiles(path, fobj): |
|
|
@@ -258,7 +262,7 @@ def dofileadd(cd, parent, path, name): |
|
|
|
if klass is None or klass is IgnoreFile: |
|
|
|
return |
|
|
|
|
|
|
|
#log.msg('matched:', os.path.join(path, name), `i`, `klass`) |
|
|
|
print 'matched:', os.path.join(path, name), `i`, `klass` |
|
|
|
return cd.addItem(parent, klass, name, **kwargs) |
|
|
|
|
|
|
|
class FSDirectory(FSObject, StorageFolder): |
|
|
|