Fix get_date_from_string function
This commit is contained in:
parent
e0509cdb57
commit
34e58d6a0f
|
@ -143,6 +143,9 @@ class FPath:
|
|||
# Delete separator
|
||||
if re.search('^[-_ .]', part):
|
||||
part = part[1:]
|
||||
if part != stem:
|
||||
# We only want to match first result
|
||||
break
|
||||
elif item == 'date':
|
||||
date = metadata['date_media']
|
||||
# early morning photos can be grouped with previous day
|
||||
|
|
|
@ -69,7 +69,7 @@ def get_date_regex(user_regex=None):
|
|||
# regex to match date format type %Y%m%d, %y%m%d, %d%m%Y,
|
||||
# etc...
|
||||
'a': re.compile(
|
||||
r'.*[_-]?(?P<year>\d{4})[_-]?(?P<month>\d{2})[_-]?(?P<day>\d{2})[_-]?(?P<hour>\d{2})[_-]?(?P<minute>\d{2})[_-]?(?P<second>\d{2})'
|
||||
r'[-_./](?P<year>\d{4})[-_.]?(?P<month>\d{2})[-_.]?(?P<day>\d{2})[-_.]?(?P<hour>\d{2})[-_.]?(?P<minute>\d{2})[-_.]?(?P<second>\d{2})'
|
||||
),
|
||||
'b': re.compile(
|
||||
r'[-_./](?P<year>\d{4})[-_.]?(?P<month>\d{2})[-_.]?(?P<day>\d{2})[-_./]'
|
||||
|
|
Loading…
Reference in New Issue