mirror of
https://github.com/sashacmc/photo-importer.git
synced 2024-11-16 10:08:40 +02:00
Version 1.2.4
Add time_shift options Lower case file ext during renaming
This commit is contained in:
parent
ab32542882
commit
3e37cb28d4
7
debian/changelog
vendored
7
debian/changelog
vendored
@ -1,3 +1,10 @@
|
||||
photo-importer (1.2.4) stable; urgency=medium
|
||||
|
||||
* Add time_shift options
|
||||
* Lower case file ext during renaming
|
||||
|
||||
-- Alexander Bushnev <Alexander@Bushnev.pro> Wed, 22 May 2024 23:12:07 +0200
|
||||
|
||||
photo-importer (1.2.3) stable; urgency=medium
|
||||
|
||||
* Update ci workflows
|
||||
|
2
debian/control
vendored
2
debian/control
vendored
@ -2,7 +2,7 @@ Source: photo-importer
|
||||
Section: utils
|
||||
Priority: optional
|
||||
Maintainer: Alexander Bushnev, <Alexander@Bushnev.pro>
|
||||
Build-Depends: debhelper (>= 7), python3-all, dh-python, python3-setuptools, dh-systemd, cdbs
|
||||
Build-Depends: debhelper (>= 7), python3-all, dh-python, python3-setuptools, cdbs
|
||||
Standards-Version: 3.9.2
|
||||
XS-Python3-Version: >= 3.2
|
||||
|
||||
|
@ -45,7 +45,11 @@ use_shutil = 0
|
||||
# Add original filename, if it does not contain a timestamp (bool, 0/1)
|
||||
# (Useful if filename contains some notable information)
|
||||
add_orig_name = 0
|
||||
|
||||
|
||||
# This time shift (in seconds) will be added to the original timestamp during renaming
|
||||
# (useful if original file have a wrong timestamp, timestamp will no affected)
|
||||
time_shift = 0
|
||||
|
||||
[server]
|
||||
# Server port
|
||||
port = 8080
|
||||
|
@ -32,6 +32,7 @@ class Config(object):
|
||||
'use_jpegtran': 0,
|
||||
'use_shutil': 0,
|
||||
'add_orig_name': 0,
|
||||
'time_shift': 0,
|
||||
},
|
||||
'server': {
|
||||
'port': 8080,
|
||||
|
@ -90,7 +90,7 @@ class FileProp(object):
|
||||
|
||||
def __type_by_ext(self, ext):
|
||||
try:
|
||||
return self.EXT_TO_TYPE[ext.lower()]
|
||||
return self.EXT_TO_TYPE[ext]
|
||||
except KeyError:
|
||||
logging.warning('Unknown ext: ' + ext)
|
||||
return IGNORE
|
||||
@ -182,10 +182,14 @@ class FileProp(object):
|
||||
def get(self, fullname):
|
||||
path, fname_ext = os.path.split(fullname)
|
||||
fname, ext = os.path.splitext(fname_ext)
|
||||
ext = ext.lower()
|
||||
|
||||
tp = self.__type_by_ext(ext)
|
||||
|
||||
ftime = self.__time(fullname, fname, tp)
|
||||
time_shift = self.__config['main']['time_shift']
|
||||
if ftime and time_shift:
|
||||
ftime += datetime.timedelta(seconds=int(time_shift))
|
||||
|
||||
if ftime:
|
||||
out_name = ftime.strftime(
|
||||
|
6
setup.py
6
setup.py
@ -4,9 +4,7 @@ import os
|
||||
|
||||
def get_long_description():
|
||||
this_directory = os.path.abspath(os.path.dirname(__file__))
|
||||
with open(
|
||||
os.path.join(this_directory, 'README.md'), encoding='utf-8'
|
||||
) as f:
|
||||
with open(os.path.join(this_directory, 'README.md'), encoding='utf-8') as f:
|
||||
long_description = f.read()
|
||||
|
||||
return long_description
|
||||
@ -14,7 +12,7 @@ def get_long_description():
|
||||
|
||||
setup(
|
||||
name='photo-importer',
|
||||
version='1.2.3',
|
||||
version='1.2.4',
|
||||
description='Photo importer tool',
|
||||
author='Alexander Bushnev',
|
||||
author_email='Alexander@Bushnev.pro',
|
||||
|
Loading…
Reference in New Issue
Block a user