From 7d561cea0e50d30d3165797ef97e3de7ef9232dc Mon Sep 17 00:00:00 2001 From: William McBrine Date: Thu, 19 Feb 2009 23:02:04 -0500 Subject: [PATCH] Use mtime rather than ctime. --- plugin.py | 2 +- plugins/video/video.py | 7 ++++--- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/plugin.py b/plugin.py index 5c268e8..dc773f1 100644 --- a/plugin.py +++ b/plugin.py @@ -176,7 +176,7 @@ class Plugin(object): return cmp(x, y) def date_sort(x, y): - return cmp(os.stat(y).st_ctime, os.stat(x).st_ctime) + return cmp(os.stat(y).st_mtime, os.stat(x).st_mtime) if query.get('SortOrder', ['Normal'])[0] == 'Random': seed = query.get('RandomSeed', ['1'])[0] diff --git a/plugins/video/video.py b/plugins/video/video.py index a28cd16..7a011e2 100644 --- a/plugins/video/video.py +++ b/plugins/video/video.py @@ -136,9 +136,10 @@ class Video(Plugin): metadata = {} base_path, title = os.path.split(full_path) - ctime = os.stat(full_path).st_ctime - if (ctime < 0): ctime = 0 - originalAirDate = datetime.fromtimestamp(ctime) + mtime = os.stat(full_path).st_mtime + if (mtime < 0): + mtime = 0 + originalAirDate = datetime.fromtimestamp(mtime) metadata['title'] = '.'.join(title.split('.')[:-1]) metadata['originalAirDate'] = originalAirDate.isoformat() -- 2.11.4.GIT