mirror of
https://github.com/beetbox/beets.git
synced 2025-12-22 16:43:25 +01:00
lastgenre: Use pathlib for opening tree file
instead of syspath(normpath()) Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
This commit is contained in:
parent
0cdb1224b9
commit
fbd90b0507
1 changed files with 2 additions and 3 deletions
|
|
@ -24,6 +24,7 @@ https://gist.github.com/1241307
|
|||
|
||||
import os
|
||||
import traceback
|
||||
from pathlib import Path
|
||||
from typing import Union
|
||||
|
||||
import pylast
|
||||
|
|
@ -140,9 +141,7 @@ class LastGenrePlugin(plugins.BeetsPlugin):
|
|||
# Read the tree
|
||||
if c14n_filename:
|
||||
self._log.debug("Loading canonicalization tree {}", c14n_filename)
|
||||
with open(
|
||||
syspath(normpath(c14n_filename)), "r", encoding="utf-8"
|
||||
) as f:
|
||||
with Path(c14n_filename).open(encoding="utf-8") as f:
|
||||
genres_tree = yaml.safe_load(f)
|
||||
flatten_tree(genres_tree, [], c14n_branches)
|
||||
return c14n_branches, canonicalize
|
||||
|
|
|
|||
Loading…
Reference in a new issue