all repos — nasg @ 5c39f7e57acea7bc5b007d4e69e9301ecf2cb410

old photo publish date for phots that were published somewhere in the past but I don't have an exact date for them
Peter Molnar hello@petermolnar.eu
Sun, 24 Mar 2019 15:26:55 +0000
commit

5c39f7e57acea7bc5b007d4e69e9301ecf2cb410

parent

5a5723aecc207cbb269af53b5ebf71f87f3a06cd

2 files changed, 19 insertions(+), 1 deletions(-)

jump to
M nasg.pynasg.py

@@ -607,7 +607,15 @@ return self.baseN(self.published.timestamp)

@property def published(self): - return arrow.get(self.meta.get('published')) + # ok, so here's a hack: because I have no idea when my older photos + # were actually published, any photo from before 2014 will have + # the EXIF createdate as publish date + pub = arrow.get(self.meta.get('published')) + if self.is_photo: + maybe = arrow.get(self.photo.exif.get('CreateDate')) + if maybe.year < settings.photo.earlyyears: + pub = maybe + return pub @property def is_reply(self):

@@ -1398,6 +1406,15 @@ # this is to make sure pjpeg happens

with open(self.fpath, 'wb') as f: logger.info("writing %s", self.fpath) thumb.save(file=f) + + # n, e = os.path.splitext(os.path.basename(self.fpath)) + # webppath = self.fpath.replace(e, '.webp') + # with open(webppath, 'wb') as f: + # logger.info("writing %s", webppath) + # thumb.format = 'webp' + # thumb.compression_quality = 88 + # thumb.save(file=f) + class PHPFile(object):
M settings.pysettings.py

@@ -169,6 +169,7 @@ #360 = m

720: '', 1280: '_b', }, + 'earlyyears': 2014 }) tmpdir = os.path.join(gettempdir(),'nasg')