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.
This commit is contained in:
Naomi Aro 2011-06-08 19:33:16 +02:00
parent 11d18ad8e8
commit 16cfae10ed
2 changed files with 4 additions and 2 deletions

View File

@ -47,6 +47,7 @@ class StoredFile {
{ {
$this->_file = new CcFiles(); $this->_file = new CcFiles();
$this->_file->setDbGunid(md5(uniqid("", true))); $this->_file->setDbGunid(md5(uniqid("", true)));
$this->_file->save();
$this->setMetadata($md); $this->setMetadata($md);
} }

View File

@ -148,12 +148,13 @@ class MediaMonitor(ProcessEvent):
def format_length(self, mutagen_length): def format_length(self, mutagen_length):
t = float(mutagen_length) t = float(mutagen_length)
h = int(math.floor(t/3600)) h = int(math.floor(t/3600))
t = t % 3600 t = t % 3600
m = int(math.floor(t/60)) m = int(math.floor(t/60))
# will be ss.uuu
s = t % 60 s = t % 60
# will be ss.uuu
s = str(s)
s = s[:6]
length = "%s:%s:%s" % (h, m, s) length = "%s:%s:%s" % (h, m, s)