From 33a8f99d4868cf750140c7fa24ebb303f01d02f0 Mon Sep 17 00:00:00 2001 From: gryf Date: Thu, 17 Nov 2016 18:42:51 +0100 Subject: [PATCH] Changing soft fields for Image object Till now there was an idea to expose full path to image file and thumbnail. It's quite impossible in certain situations, where path to the media files is not known. Therefore 'imagepath' was removed due to redundancy with filename stored in db, and 'thumpath', which now is a simple calculation of the expected thumbnail relative filepath. --- pygtktalog/dbobjects.py | 13 +++---------- 1 file changed, 3 insertions(+), 10 deletions(-) diff --git a/pygtktalog/dbobjects.py b/pygtktalog/dbobjects.py index b257449..0fc09f4 100644 --- a/pygtktalog/dbobjects.py +++ b/pygtktalog/dbobjects.py @@ -213,20 +213,13 @@ class Image(Base): return img @property - def thumbpath(self): + def thumbnail(self): """ - Return full path to thumbnail of this image + Return path to thumbnail for this image """ path, fname = os.path.split(self.filename) base, ext = os.path.splitext(fname) - return os.path.join(self.img_path, path, base + "_t" + ext) - - @property - def imagepath(self): - """ - Return full path to image - """ - return os.path.join(self.img_path, self.filename) + return os.path.join(path, base + "_t" + ext) def __repr__(self): return "" % (str(self.filename), str(self.id))