sortable dates for file names on sync device

Signed-off-by: Rafi Rubin <rafi@seas.upenn.edu>
This commit is contained in:
Rafi Rubin 2012-08-29 21:41:46 -04:00
parent 50501c809c
commit d91b837880
2 changed files with 5 additions and 1 deletions

View File

@ -166,7 +166,7 @@ defaults = {
'max_filename_length': 999,
'custom_sync_name': '{episode.pubdate_prop}_{episode.title}',
'custom_sync_name': '{episode.sortdate}_{episode.title}',
'custom_sync_name_enabled': False,
'after_sync': {

View File

@ -733,6 +733,10 @@ class PodcastEpisode(PodcastModelObject):
pubdate_prop = property(fget=cute_pubdate)
@property
def sortdate(self):
return str(datetime.datetime.fromtimestamp(self.published).strftime('%F'))
def calculate_filesize(self):
filename = self.local_filename(create=False)
if filename is None: