mirror of
https://github.com/beetbox/beets.git
synced 2026-02-12 10:22:13 +01:00
Appease flake8
This commit is contained in:
parent
c4a62fc248
commit
6777b49bcf
1 changed files with 2 additions and 4 deletions
|
|
@ -1123,16 +1123,14 @@ class ArchiveImportTask(SentinelImportTask):
|
|||
try:
|
||||
archive.extractall(extract_to)
|
||||
|
||||
# Adjust the files' mtimes to match the information from the archive. Inspired by:
|
||||
# https://stackoverflow.com/q/9813243
|
||||
|
||||
# Adjust the files' mtimes to match the information from the
|
||||
# archive. Inspired by: https://stackoverflow.com/q/9813243
|
||||
for f in archive.infolist():
|
||||
# The date_time will need to adjusted otherwise
|
||||
# the item will have the current date_time of extraction.
|
||||
# The (0, 0, -1) is added to date_time because the
|
||||
# function time.mktime expects a 9-element tuple.
|
||||
# The -1 indicates that the DST flag is unknown.
|
||||
|
||||
date_time = time.mktime(f.date_time + (0, 0, -1))
|
||||
fullpath = os.path.join(extract_to, f.filename)
|
||||
os.utime(fullpath, (date_time, date_time))
|
||||
|
|
|
|||
Loading…
Reference in a new issue