support caching local files, lookup by oshash

This commit is contained in:
j 2016-02-14 00:32:14 +05:30
commit b121b58a86
4 changed files with 65 additions and 18 deletions

View file

@ -711,6 +711,16 @@ class Stream(models.Model):
_self.update_status(ok, error)
return _self
def get_index(self):
index = 1
for s in self.file.item.streams():
if self.source and self.source == s:
return index
if s == self:
return index
index += 1
return None
def update_status(self, ok, error):
if ok:
if not self.media: