beetsplug/playlist: actually use SQL clause

As far as I can tell, the fast SQL path was never used before, since a
query would use the default `clause()` implementation. It is only the
`FieldQuery.clause()` that could delegate to `col_clause()`, but
`PlaylistQuery` is not a `FieldQuery`.
This commit is contained in:
wisp3rwind 2023-06-23 11:00:09 +02:00
parent 09d2c87f29
commit bc7c447b3c

View file

@ -15,6 +15,7 @@
import os
import fnmatch
import tempfile
from typing import Any, Optional, Sequence, Tuple
import beets
from beets.util import path_as_posix
@ -65,7 +66,7 @@ class PlaylistQuery(beets.dbcore.NamedQuery):
f.close()
break
def col_clause(self):
def clause(self) -> Tuple[Optional[str], Sequence[Any]]:
if not self.paths:
# Playlist is empty
return '0', ()