From 16cfae10ed8416fd79612b011bc5d369fa4f08da Mon Sep 17 00:00:00 2001 From: Naomi Aro Date: Wed, 8 Jun 2011 19:33:16 +0200 Subject: [PATCH] CC-1799 Put Airtime Storage into a Human Readable File Naming Convention working on proper length saving. need to fix substring method to ensure all get same number of subseconds to be consistent. --- airtime_mvc/application/models/StoredFile.php | 1 + python_apps/media-monitor/MediaMonitor.py | 5 +++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/airtime_mvc/application/models/StoredFile.php b/airtime_mvc/application/models/StoredFile.php index 1c8dcef42..7e2102677 100644 --- a/airtime_mvc/application/models/StoredFile.php +++ b/airtime_mvc/application/models/StoredFile.php @@ -47,6 +47,7 @@ class StoredFile { { $this->_file = new CcFiles(); $this->_file->setDbGunid(md5(uniqid("", true))); + $this->_file->save(); $this->setMetadata($md); } diff --git a/python_apps/media-monitor/MediaMonitor.py b/python_apps/media-monitor/MediaMonitor.py index 05704e724..3b5899f31 100644 --- a/python_apps/media-monitor/MediaMonitor.py +++ b/python_apps/media-monitor/MediaMonitor.py @@ -148,12 +148,13 @@ class MediaMonitor(ProcessEvent): def format_length(self, mutagen_length): t = float(mutagen_length) h = int(math.floor(t/3600)) - t = t % 3600 m = int(math.floor(t/60)) - # will be ss.uuu s = t % 60 + # will be ss.uuu + s = str(s) + s = s[:6] length = "%s:%s:%s" % (h, m, s)