Skip to content

Commit cf557fb

Browse files
JOJ0snejus
andcommitted
playlist: Use pathlib.Path and add types for is_m3u_file()
Co-authored-by: Šarūnas Nejus <[email protected]>
1 parent 257991c commit cf557fb

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

beetsplug/playlist.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,14 +15,15 @@
1515
import os
1616
import tempfile
1717
from collections.abc import Sequence
18+
from pathlib import Path
1819

1920
import beets
2021
from beets.dbcore.query import BLOB_TYPE, InQuery
2122
from beets.util import path_as_posix
2223

2324

24-
def is_m3u_file(path):
25-
return os.path.splitext(path)[1].lower() in {".m3u", ".m3u8"}
25+
def is_m3u_file(path: str) -> bool:
26+
return Path(path).suffix.lower() in {".m3u", ".m3u8"}
2627

2728

2829
class PlaylistQuery(InQuery[bytes]):

0 commit comments

Comments
 (0)