diff options
Diffstat (limited to 'recorded.py')
-rwxr-xr-x[-rw-r--r--] | recorded.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/recorded.py b/recorded.py index 9296742..8ee8e3d 100644..100755 --- a/recorded.py +++ b/recorded.py @@ -27,7 +27,8 @@ import utils import serialize class Recorded: - def __init__( self ): + def __init__( self, activity ): + self.activity = activity self.type = -1 self.time = None self.recorderName = None @@ -115,11 +116,11 @@ class Recorded: def getThumbFilepath( self ): if not self.thumbFilename: return None - return os.path.join(Instance.instancePath, self.thumbFilename) + return os.path.join(self.activity.Instance.get_path(), self.thumbFilename) def make_thumb_path(self): thumbFilename = self.mediaFilename + "_thumb.jpg" - thumbFilepath = os.path.join(Instance.instancePath, thumbFilename) + thumbFilepath = os.path.join(self.activity.Instance.get_path(), thumbFilename) thumbFilepath = utils.getUniqueFilepath(thumbFilepath, 0) self.thumbFilename = os.path.basename(thumbFilepath) return self.getThumbFilepath() @@ -139,7 +140,7 @@ class Recorded: def getAudioImageFilepath( self ): if (self.audioImageFilename != None): - audioFilepath = os.path.join(Instance.instancePath, self.audioImageFilename) + audioFilepath = os.path.join(self.activity.Instance.get_path(), self.audioImageFilename) return os.path.abspath(audioFilepath) else: return self.getThumbFilepath() @@ -149,24 +150,24 @@ class Recorded: if (self.datastoreId == None): if (not self.buddy): #just taken by you, so it is in the tempSessionDir - mediaFilepath = os.path.join(Instance.instancePath, self.mediaFilename) + mediaFilepath = os.path.join(self.activity.Instance.get_path(), self.mediaFilename) return os.path.abspath(mediaFilepath) else: if (self.downloadedFromBuddy): #the user has requested the high-res version, and it has downloaded - mediaFilepath = os.path.join(Instance.instancePath, self.mediaFilename) + mediaFilepath = os.path.join(self.activity.Instance.get_path(), self.mediaFilename) return os.path.abspath(mediaFilepath) else: if self.mediaFilename == None: #creating a new filepath, probably just got here from the mesh ext = constants.MEDIA_INFO[self.type]['ext'] - recdPath = os.path.join(Instance.instancePath, "recdFile_"+self.mediaMd5+"."+ext) + recdPath = os.path.join(self.activity.Instance.get_path(), "recdFile_"+self.mediaMd5+"."+ext) recdPath = utils.getUniqueFilepath(recdPath, 0) self.mediaFilename = os.path.basename(recdPath) - mediaFilepath = os.path.join(Instance.instancePath, self.mediaFilename) + mediaFilepath = os.path.join(self.activity.Instance.get_path(), self.mediaFilename) return os.path.abspath(mediaFilepath) else: - mediaFilepath = os.path.join(Instance.instancePath, self.mediaFilename) + mediaFilepath = os.path.join(self.activity.Instance.get_path(), self.mediaFilename) return os.path.abspath(mediaFilepath) else: #pulling from the datastore, regardless of who took it, cause we got it |