no manual data if item has imdb id

This commit is contained in:
j 2011-11-22 17:49:38 +01:00
parent 98119eb400
commit fd7bd7a704
3 changed files with 19 additions and 9 deletions

View file

@ -11,8 +11,11 @@ import managers
class MetaClip: class MetaClip:
def update_calculated_values(self): def update_calculated_values(self):
start = min(self.start, self.item.sort.duration) start = self.start
end = min(self.end, self.item.sort.duration) end = self.end
if self.item.sort.duration:
start = min(self.start, self.item.sort.duration)
end = min(self.end, self.item.sort.duration)
self.duration = end - start self.duration = end - start
if self.duration > 0: if self.duration > 0:
self.hue, self.saturation, self.lightness = extract.average_color( self.hue, self.saturation, self.lightness = extract.average_color(

View file

@ -290,6 +290,11 @@ class Item(models.Model):
if settings.USE_IMDB and len(self.itemId) != 7 and self.oxdbId != self.itemId: if settings.USE_IMDB and len(self.itemId) != 7 and self.oxdbId != self.itemId:
self.itemId = self.oxdbId self.itemId = self.oxdbId
#FIXME: move files to new id here #FIXME: move files to new id here
if settings.USE_IMDB and len(self.itemId) == 7:
for key in ('title', 'year', 'director', 'season', 'episode',
'seriesTitle', 'episodeTitle'):
if key in self.data:
del self.data[key]
if self.poster and os.path.exists(self.poster.path): if self.poster and os.path.exists(self.poster.path):
self.poster_height = self.poster.height self.poster_height = self.poster.height

View file

@ -402,13 +402,15 @@ pandora.ui.filesView = function(options, self) {
data[key] = self['$' + key + 'Input'].value(); data[key] = self['$' + key + 'Input'].value();
}); });
pandora.api.moveFiles(data, function(result) { pandora.api.moveFiles(data, function(result) {
if (self.$checkbox.value()) { if(pandora.user.ui.item == self.options.id && pandora.user.ui.itemView == 'files') {
Ox.Request.clearCache(); // fixme: remove if (self.$checkbox.value()) {
pandora.UI.set({item: result.data.itemId}); Ox.Request.clearCache(); // fixme: remove
} else { pandora.UI.set({item: result.data.itemId});
Ox.Log('', 'moved', self.selected, result.data.itemId); } else {
self.$filesList.reloadList(); Ox.Log('', 'moved', self.selected, result.data.itemId);
self.$instancesList.reloadList(); self.$filesList.reloadList();
self.$instancesList.reloadList();
}
} }
}); });
} }