Removed option to build index. Filebased sources should always have an index
This commit is contained in:
parent
c381133252
commit
8828733271
2 changed files with 3 additions and 3 deletions
|
@ -17,7 +17,7 @@ except ImportError:
|
||||||
PYMEDIAINFO_AVAILABLE = False
|
PYMEDIAINFO_AVAILABLE = False
|
||||||
|
|
||||||
from .source import Source
|
from .source import Source
|
||||||
from ..config import BoolOption, ListStrOption, ConfigOption
|
from ..config import ListStrOption, ConfigOption
|
||||||
|
|
||||||
|
|
||||||
class FileBasedSource(Source):
|
class FileBasedSource(Source):
|
||||||
|
@ -34,10 +34,10 @@ class FileBasedSource(Source):
|
||||||
"List of filename extensions\n(mp3+cdg, mp4, ...)",
|
"List of filename extensions\n(mp3+cdg, mp4, ...)",
|
||||||
["mp3+cdg"],
|
["mp3+cdg"],
|
||||||
),
|
),
|
||||||
"build_index": ConfigOption(BoolOption(), "Build index on startup", True),
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def apply_config(self, config: dict[str, Any]) -> None:
|
def apply_config(self, config: dict[str, Any]) -> None:
|
||||||
|
self.build_index = True
|
||||||
self.extensions: list[str] = config["extensions"] if "extensions" in config else ["mp3+cdg"]
|
self.extensions: list[str] = config["extensions"] if "extensions" in config else ["mp3+cdg"]
|
||||||
self.extra_mpv_options = {"scale": "oversample"}
|
self.extra_mpv_options = {"scale": "oversample"}
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ class Source(ABC):
|
||||||
self._index: list[str] = config["index"] if "index" in config else []
|
self._index: list[str] = config["index"] if "index" in config else []
|
||||||
self.extra_mpv_options: dict[str, str] = {}
|
self.extra_mpv_options: dict[str, str] = {}
|
||||||
self._skip_next = False
|
self._skip_next = False
|
||||||
self.build_index = config.get("build_index", False)
|
self.build_index = False
|
||||||
self.apply_config(config)
|
self.apply_config(config)
|
||||||
|
|
||||||
def is_valid(self, entry: Entry) -> bool:
|
def is_valid(self, entry: Entry) -> bool:
|
||||||
|
|
Loading…
Add table
Reference in a new issue