Add timestamp to mappings
Return `field` instead of '' so that a missing mapping returns itself.
This commit is contained in:
1 parent
83dc375810
commit
b6334ce41c
1 file changed
+6
-1
@@ -664,6 +664,11 @@ class Media(models.Model):
|
|||||||
Source.SOURCE_TYPE_YOUTUBE_CHANNEL_ID: 'upload_date',
|
Source.SOURCE_TYPE_YOUTUBE_CHANNEL_ID: 'upload_date',
|
||||||
Source.SOURCE_TYPE_YOUTUBE_PLAYLIST: 'upload_date',
|
Source.SOURCE_TYPE_YOUTUBE_PLAYLIST: 'upload_date',
|
||||||
},
|
},
|
||||||
|
'timestamp': {
|
||||||
|
Source.SOURCE_TYPE_YOUTUBE_CHANNEL: 'timestamp',
|
||||||
|
Source.SOURCE_TYPE_YOUTUBE_CHANNEL_ID: 'timestamp',
|
||||||
|
Source.SOURCE_TYPE_YOUTUBE_PLAYLIST: 'timestamp',
|
||||||
|
},
|
||||||
'title': {
|
'title': {
|
||||||
Source.SOURCE_TYPE_YOUTUBE_CHANNEL: 'title',
|
Source.SOURCE_TYPE_YOUTUBE_CHANNEL: 'title',
|
||||||
Source.SOURCE_TYPE_YOUTUBE_CHANNEL_ID: 'title',
|
Source.SOURCE_TYPE_YOUTUBE_CHANNEL_ID: 'title',
|
||||||
@@ -944,7 +949,7 @@ class Media(models.Model):
|
|||||||
|
|
||||||
def get_metadata_field(self, field):
|
def get_metadata_field(self, field):
|
||||||
fields = self.METADATA_FIELDS.get(field, {})
|
fields = self.METADATA_FIELDS.get(field, {})
|
||||||
return fields.get(self.source.source_type, '')
|
return fields.get(self.source.source_type, field)
|
||||||
|
|
||||||
def iter_formats(self):
|
def iter_formats(self):
|
||||||
for fmt in self.formats:
|
for fmt in self.formats:
|
||||||
|
|||||||
Reference in new issue
Block a user