rm file
This commit is contained in:
@ -3,6 +3,7 @@ import tzlocal
|
||||
|
||||
from aircox.utils import to_seconds
|
||||
|
||||
from ..conf import settings
|
||||
from .metadata import Metadata, Request
|
||||
|
||||
|
||||
@ -76,7 +77,7 @@ class PlaylistSource(Source):
|
||||
self.program = program
|
||||
|
||||
super().__init__(controller, id=id, **kwargs)
|
||||
self.path = os.path.join(self.station.path, f"{self.id}.m3u")
|
||||
self.path = settings.get_dir(self.station, f"{self.id}.m3u")
|
||||
|
||||
def get_sound_queryset(self):
|
||||
"""Get playlist's sounds queryset."""
|
||||
@ -88,6 +89,7 @@ class PlaylistSource(Source):
|
||||
|
||||
def write_playlist(self, playlist=[]):
|
||||
"""Write playlist to file."""
|
||||
playlist = playlist or self.get_playlist()
|
||||
os.makedirs(os.path.dirname(self.path), exist_ok=True)
|
||||
with open(self.path, "w") as file:
|
||||
file.write("\n".join(playlist or []))
|
||||
|
Reference in New Issue
Block a user