From: Guillaume Pellerin Date: Fri, 13 Nov 2015 14:45:28 +0000 (+0100) Subject: fix playlist resource type X-Git-Tag: 1.6b~7^2~55 X-Git-Url: https://git.parisson.com/?a=commitdiff_plain;h=d90ff60c5bfffe5b92fd9be06457564a784e351a;p=telemeta.git fix playlist resource type --- diff --git a/telemeta/locale b/telemeta/locale index 4534a3d4..91973b13 160000 --- a/telemeta/locale +++ b/telemeta/locale @@ -1 +1 @@ -Subproject commit 4534a3d47e7909554637e87a637b1959db277941 +Subproject commit 91973b13f9dc9405052727c0c525d342dee15562 diff --git a/telemeta/management/commands/telemeta-export-playlist-to-csv.py b/telemeta/management/commands/telemeta-export-playlist-to-csv.py index 185df544..fd6f687e 100644 --- a/telemeta/management/commands/telemeta-export-playlist-to-csv.py +++ b/telemeta/management/commands/telemeta-export-playlist-to-csv.py @@ -10,7 +10,7 @@ from timeside.server.models import * from timeside.core.tools.test_samples import generateSamples from telemeta.models import * from telemeta.util.unicode import * - +from telemeta.views import PlaylistView class Command(BaseCommand): help = "Export all items or collections metadata to a CSV file" @@ -18,14 +18,11 @@ class Command(BaseCommand): def handle(self, *args, **options): path = args[-1] public_id = args[-2] + resource_type = args[-3] f = open(path, 'w') playlist = Playlist.objects.get(public_id=public_id) - elements = [] - for resource in playlist.resources.all(): - if resource.resource_type == "item": - elements.append(MediaItem.objects.get(public_id=resource.resource_id)) - elif resource.resource_type == "collection": - elements.append(MediaCollection.objects.get(public_id=resource.resource_id)) + view = PlaylistView() + elements = view.get_elements(playlist, resource_type) writer = UnicodeWriter(f) csv = CSVExport(writer) csv.write(elements) diff --git a/telemeta/pages b/telemeta/pages index ff2bfd95..f8324093 160000 --- a/telemeta/pages +++ b/telemeta/pages @@ -1 +1 @@ -Subproject commit ff2bfd95504603e16b17134aa774b392bf693ec0 +Subproject commit f8324093174d077b674ac2c52eb0db6eaf815ab5