diff --git a/pandora/archive/admin.py b/pandora/archive/admin.py index 4af841b..6a7763f 100644 --- a/pandora/archive/admin.py +++ b/pandora/archive/admin.py @@ -7,14 +7,14 @@ from django.contrib import admin import models class FileAdmin(admin.ModelAdmin): - search_fields = ['path', 'video_codec'] + search_fields = ['name', 'video_codec'] #form = FileAdminForm admin.site.register(models.File, FileAdmin) class InstanceAdmin(admin.ModelAdmin): - search_fields = ['path', 'volume__name'] + search_fields = ['name', 'volume', 'volume__name'] #form = ArchiveFileAdminForm admin.site.register(models.Instance, InstanceAdmin) diff --git a/pandora/item/utils.py b/pandora/item/utils.py index ca002be..989bae7 100644 --- a/pandora/item/utils.py +++ b/pandora/item/utils.py @@ -44,7 +44,7 @@ def oxdb_id(title, directors=[], year='', season='', episode='', episode_title=' return u'0x' + oxdb_id def oxdb_directors(director): - director = os.path.basename(os.path.dirname(os.path.dirname(director))) + director = os.path.basename(os.path.dirname(director)) if director.endswith('_'): director = "%s." % director[:-1] directors = [normalizeName(d) for d in director.split('; ')] @@ -96,7 +96,7 @@ def oxdb_year(data): def oxdb_series_title(path): seriesTitle = u'' if path.startswith('Series'): - seriesTitle = os.path.basename(os.path.dirname(path)) + seriesTitle = os.path.basename(path) else: t = oxdb_title(path) if " (S" in t: @@ -142,6 +142,12 @@ def oxdb_part(path): return part def parse_path(path): + ''' + expects path in the form + L/Last, First/Title (YYYY) + M/McCarthy, Thomas/The Visitor (2007) + G/Godard, Jean-Luc/Histoire(s) du cinema_ Toutes les histoires (1988) + ''' import ox.web.imdb search_title = oxdb_title(path, True) r = {}