refactor: Rename global current playlist methods for clarity and consistency
This commit is contained in:
@@ -53,20 +53,7 @@ class PlaylistRepository(BaseRepository[Playlist]):
|
||||
logger.exception("Failed to get main playlist")
|
||||
raise
|
||||
|
||||
async def get_current_playlist(self, user_id: int) -> Playlist | None:
|
||||
"""Get the user's current playlist."""
|
||||
try:
|
||||
statement = select(Playlist).where(
|
||||
Playlist.user_id == user_id,
|
||||
Playlist.is_current == True, # noqa: E712
|
||||
)
|
||||
result = await self.session.exec(statement)
|
||||
return result.first()
|
||||
except Exception:
|
||||
logger.exception("Failed to get current playlist for user: %s", user_id)
|
||||
raise
|
||||
|
||||
async def get_global_current_playlist(self) -> Playlist | None:
|
||||
async def get_current_playlist(self) -> Playlist | None:
|
||||
"""Get the global current playlist (app-wide)."""
|
||||
try:
|
||||
statement = select(Playlist).where(
|
||||
@@ -75,7 +62,7 @@ class PlaylistRepository(BaseRepository[Playlist]):
|
||||
result = await self.session.exec(statement)
|
||||
return result.first()
|
||||
except Exception:
|
||||
logger.exception("Failed to get global current playlist")
|
||||
logger.exception("Failed to get current playlist")
|
||||
raise
|
||||
|
||||
async def search_by_name(
|
||||
|
||||
Reference in New Issue
Block a user