save alternative titles as title and link to title search on infoView

This commit is contained in:
j 2013-03-24 19:44:48 +00:00
parent 8d3ba66bb4
commit 2fa2e80fc4
2 changed files with 12 additions and 2 deletions

View file

@ -635,8 +635,13 @@ class Item(models.Model):
for key in settings.CONFIG['itemKeys']: for key in settings.CONFIG['itemKeys']:
i = key['id'] i = key['id']
if i == 'title': if i == 'title':
save(i, u'\n'.join([self.get('title', 'Untitled'), titles = [self.get('title', 'Untitled')]
self.get('originalTitle', '')])) if self.get('originalTitle'):
titles.append(self.get('originalTitle'))
at = self.get('alternativeTitles')
if at:
titles += [a[0] for a in at]
save(i, u'\n'.join(titles))
elif i == 'rightslevel': elif i == 'rightslevel':
save(i, self.level) save(i, self.level)
elif i == 'filename': elif i == 'filename':
@ -881,6 +886,9 @@ class Item(models.Model):
ot = self.get('originalTitle') ot = self.get('originalTitle')
if ot: if ot:
current_values.append(ot) current_values.append(ot)
at = self.get('alternativeTitles')
if at:
current_values += [a[0] for a in at]
elif key == 'character': elif key == 'character':
current_values = filter(lambda x: x.strip(), current_values = filter(lambda x: x.strip(),
[f['character'] for f in self.get('cast', [])]) [f['character'] for f in self.get('cast', [])])

View file

@ -567,6 +567,8 @@ pandora.ui.infoView = function(data) {
ret = formatLink(value.split(', '), 'name'); ret = formatLink(value.split(', '), 'name');
} else if (listKeys.indexOf(key) > -1) { } else if (listKeys.indexOf(key) > -1) {
ret = formatLink(value.split(', '), key); ret = formatLink(value.split(', '), key);
} else if (key == 'alternativeTitles') {
ret = formatLink(value.split('; '), 'title');
} else if (specialListKeys.indexOf(key) > -1) { } else if (specialListKeys.indexOf(key) > -1) {
ret = formatLink(value.split('; '), key); ret = formatLink(value.split('; '), key);
} else if (key == 'imdbId') { } else if (key == 'imdbId') {