mirror of
https://github.com/beetbox/beets.git
synced 2026-01-08 17:08:12 +01:00
Merge pull request #3929 from arogl/7z_support
Add 7z file support #3906
This commit is contained in:
commit
747486432f
6 changed files with 21 additions and 2 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
|
||||
|
||||
|
|
|
|||
|
|
@ -216,6 +216,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://pypi.org/project/py7zr/
|
||||
|
||||
Fixes:
|
||||
|
||||
|
|
|
|||
|
|
@ -67,7 +67,7 @@ albums (the latter case is true of typical Artist/Album organizations
|
|||
and many people's "downloads" folders). The path can also be a single
|
||||
song or an archive. Beets supports `zip` and `tar` archives out of the
|
||||
box. To extract `rar` files, install the `rarfile`_ package and the
|
||||
`unrar` command.
|
||||
`unrar` command. To extract `7z` files, install the `py7zr`_ package.
|
||||
|
||||
Optional command flags:
|
||||
|
||||
|
|
@ -152,6 +152,7 @@ Optional command flags:
|
|||
beet import --set genre="Alternative Rock" --set mood="emotional"
|
||||
|
||||
.. _rarfile: https://pypi.python.org/pypi/rarfile/
|
||||
.. _py7zr: https://pypi.org/project/py7zr/
|
||||
|
||||
.. only:: html
|
||||
|
||||
|
|
|
|||
4
setup.py
4
setup.py
|
|
@ -130,7 +130,9 @@ setup(
|
|||
] + [
|
||||
'discogs-client' if (sys.version_info < (3, 0, 0))
|
||||
else 'python3-discogs-client'
|
||||
],
|
||||
] + (
|
||||
['py7zr'] if (sys.version_info > (3, 5, 0)) else []
|
||||
),
|
||||
'lint': [
|
||||
'flake8',
|
||||
'flake8-coding',
|
||||
|
|
|
|||
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