mirror of
https://github.com/beetbox/beets.git
synced 2025-12-06 08:39:17 +01:00
Improve regexp and module docstring
This commit is contained in:
parent
0ac7fb42f5
commit
80ffa4879d
1 changed files with 3 additions and 3 deletions
|
|
@ -12,8 +12,8 @@
|
||||||
# The above copyright notice and this permission notice shall be
|
# The above copyright notice and this permission notice shall be
|
||||||
# included in all copies or substantial portions of the Software.
|
# included in all copies or substantial portions of the Software.
|
||||||
|
|
||||||
"""If the title is empty, try to extract track and title from the
|
"""If the title is empty, try to extract it from the filename
|
||||||
filename.
|
(possibly also extract track and artist)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
@ -30,7 +30,7 @@ PATTERNS = [
|
||||||
r"(\s*-\s*(?P<tag>.*))?$"
|
r"(\s*-\s*(?P<tag>.*))?$"
|
||||||
),
|
),
|
||||||
r"^(?P<artist>.+?)\s*-\s*(?P<title>.+?)(\s*-\s*(?P<tag>.*))?$",
|
r"^(?P<artist>.+?)\s*-\s*(?P<title>.+?)(\s*-\s*(?P<tag>.*))?$",
|
||||||
r"^(?P<track>\d+)\.?[\s\-_]+(?P<title>.+)$",
|
r"^(?P<track>\d+)\.?[\s_-]+(?P<title>.+)$",
|
||||||
r"^(?P<title>.+) by (?P<artist>.+)$",
|
r"^(?P<title>.+) by (?P<artist>.+)$",
|
||||||
r"^(?P<track>\d+).*$",
|
r"^(?P<track>\d+).*$",
|
||||||
r"^(?P<title>.+)$",
|
r"^(?P<title>.+)$",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue