mirror of
https://github.com/beetbox/beets.git
synced 2026-01-13 11:41:43 +01:00
Add 7z file support #3906
This commit is contained in:
parent
2fa3717731
commit
533559136e
5 changed files with 17 additions and 0 deletions
|
|
@ -1054,6 +1054,12 @@ class ArchiveImportTask(SentinelImportTask):
|
|||
pass
|
||||
else:
|
||||
cls._handlers.append((is_rarfile, RarFile))
|
||||
try:
|
||||
from py7zr import is_7zfile, SevenZipFile
|
||||
except ImportError:
|
||||
pass
|
||||
else:
|
||||
cls._handlers.append((is_7zfile, SevenZipFile))
|
||||
|
||||
return cls._handlers
|
||||
|
||||
|
|
|
|||
|
|
@ -214,6 +214,10 @@ Other new things:
|
|||
``check_on_import`` config option.
|
||||
* :doc:`/plugins/export`: big speedups when `--include-keys` option is used
|
||||
Thanks to :user:`ssssam`.
|
||||
* Added 7z support via the `py7zr`_ library
|
||||
Thanks to :user:`arogl`. :bug:`3906`
|
||||
|
||||
.. _py7zr: https://github.com/miurahr/py7zr
|
||||
|
||||
Fixes:
|
||||
|
||||
|
|
|
|||
1
setup.py
1
setup.py
|
|
@ -122,6 +122,7 @@ setup(
|
|||
'responses>=0.3.0',
|
||||
'requests_oauthlib',
|
||||
'reflink',
|
||||
'py7zr',
|
||||
] + (
|
||||
# Tests for the thumbnails plugin need pathlib on Python 2 too.
|
||||
['pathlib'] if (sys.version_info < (3, 4, 0)) else []
|
||||
|
|
|
|||
BIN
test/rsrc/archive.7z
Normal file
BIN
test/rsrc/archive.7z
Normal file
Binary file not shown.
|
|
@ -450,6 +450,12 @@ class ImportRarTest(ImportZipTest):
|
|||
return os.path.join(_common.RSRC, b'archive.rar')
|
||||
|
||||
|
||||
class Import7zTest(ImportZipTest):
|
||||
|
||||
def create_archive(self):
|
||||
return os.path.join(_common.RSRC, b'archive.7z')
|
||||
|
||||
|
||||
@unittest.skip('Implement me!')
|
||||
class ImportPasswordRarTest(ImportZipTest):
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue