diff options
Diffstat (limited to 'model.py')
-rwxr-xr-x | model.py | 23 |
1 files changed, 14 insertions, 9 deletions
@@ -370,24 +370,29 @@ class Model: recd.recorderName = self.get_nickname() recd.recorderHash = self.activity.Instance.keyHashPrintable + if self.activity.Instance.savePath: + recd.saveInternal = False + #to create a file, use the hardware_id+time *and* check if available or not + recd.type = type nowtime = int(time.time()) recd.time = nowtime - recd.type = type + + stringType = constants.MEDIA_INFO[type]['istr'] + + # Translators: photo by photographer, e.g. "Photo by Mary" + recd.title = _('%(type)s by %(name)s') % {'type': stringType, + 'name': recd.recorderName} - readable = constants.MEDIA_INFO[type]['istr'] + '_' + str(datetime.datetime.now()).replace(' ', '_') - mediaThumbFilename = readable + str(recd.recorderHash) + "_" + str(recd.time) + mediaThumbFilename = utils.getUniqueFilepath(recd.title + " @ " + str(recd.time), + recd.activity.Instance.get_path()) mediaFilename = mediaThumbFilename mediaFilename = mediaFilename + "." + constants.MEDIA_INFO[type]['ext'] mediaFilepath = os.path.join( self.activity.Instance.get_path(), mediaFilename ) mediaFilepath = utils.getUniqueFilepath( mediaFilepath, 0 ) recd.mediaFilename = os.path.basename( mediaFilepath ) - - stringType = constants.MEDIA_INFO[type]['istr'] - - # Translators: photo by photographer, e.g. "Photo by Mary" - recd.title = _('%(type)s by %(name)s') % {'type': stringType, - 'name': recd.recorderName} + recd.oldFilename = mediaThumbFilename + recd.oldFilepath = mediaFilepath color = sugar.profile.get_color() recd.colorStroke = color.get_stroke_color() |