mirror of
https://github.com/beetbox/beets.git
synced 2025-12-26 18:43:38 +01:00
playlist: Use pathlib.Path and add types for is_m3u_file()
Co-authored-by: Šarūnas Nejus <snejus@protonmail.com>
This commit is contained in:
parent
257991c73d
commit
cf557fb41b
1 changed files with 3 additions and 2 deletions
|
|
@ -15,14 +15,15 @@
|
|||
import os
|
||||
import tempfile
|
||||
from collections.abc import Sequence
|
||||
from pathlib import Path
|
||||
|
||||
import beets
|
||||
from beets.dbcore.query import BLOB_TYPE, InQuery
|
||||
from beets.util import path_as_posix
|
||||
|
||||
|
||||
def is_m3u_file(path):
|
||||
return os.path.splitext(path)[1].lower() in {".m3u", ".m3u8"}
|
||||
def is_m3u_file(path: str) -> bool:
|
||||
return Path(path).suffix.lower() in {".m3u", ".m3u8"}
|
||||
|
||||
|
||||
class PlaylistQuery(InQuery[bytes]):
|
||||
|
|
|
|||
Loading…
Reference in a new issue