Bugfix release
/mp3togo/track.py
blob:8d11771cb378db48717ed907b58b1ac27451ec70 -> blob:98f3dce73c4b6312636e85d819396f0270a7e06a
--- mp3togo/track.py
+++ mp3togo/track.py
@@ -28,18 +28,11 @@ import mp3togo.task as task
import mp3togo.cache as cache
from mp3togo.helpers import helpers
-#helpers = mp3togo.helpers.helpers
-
-
READY = "ready"
RUNNING = "running"
DONE = 0
FAILED = None
-DOGGFACTOR = 10
-DMP3FACTOR = 10
-DFLACFACTOR = 3
-
class Track:
"""Encapsulate the transformation of a file."""
@@ -252,16 +245,6 @@ class Track:
tasks.append(job)
del job
- ## Consider the track done if the output file exists:
- #if os.path.exists(self._outname) and not opts['force']:
- # opts.log(1, "Skipping existing file: %s\n" % self._outname)
- # self._queue = tuple(tasks)
- # if self._hash and self._cache:
- # self._cache.release(self._hash)
- # for tsk in self._queue:
- # tsk._status = task.DONE
- # self._state = DONE
- # return
if not opts['force']:
if os.path.exists(self._outname):
# In update mode, consider the track done if an existing file is older than the source
@@ -275,6 +258,7 @@ class Track:
self._cache.release(self._hash)
for tsk in self._queue:
tsk._status = task.DONE
+ self.bytes = os.stat(self._outname).st_size
self._state = DONE
return
else:
@@ -286,6 +270,7 @@ class Track:
self._cache.release(self._hash)
for tsk in self._queue:
tsk._status = task.DONE
+ self.bytes = os.stat(self._outname).st_size
self._state = DONE
return