Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

Commit c4419a4

Browse files
committed
fix(db): fix marked_as_highest_quality selector
1 parent 1e64a13 commit c4419a4

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

nowplaying/core/database.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -119,15 +119,13 @@ async def store_cached_file(
119119
)
120120

121121
async def get_cached_file(self, uri: str, *, highest_available: bool) -> CachedFile | None:
122-
highest_str = 'true' if highest_available else 'false'
123122
pool = await self.get_pool()
124123
async with pool.acquire() as conn:
125124
cached_file = await conn.fetchrow(
126125
'SELECT * FROM cached_files WHERE uri = $1 AND (quality_info @> $2 OR quality_info @> $3) LIMIT 1',
127126
uri,
128-
# NOTE(es3n1n): i don't feel like getting overhead from json dumps here
129-
f'{{"highest_available":{highest_str}}}',
130-
f'{{"marked_as_highest_available":{highest_str}}}',
127+
f'{{"highest_available":{'true' if highest_available else 'false'}}}', # direct quality match
128+
'{"marked_as_highest_available":true}', # same file for both qualities
131129
)
132130
if not cached_file:
133131
return None

0 commit comments

Comments
 (0)