mirror of
https://github.com/khoaliber/khoj.git
synced 2026-03-04 21:29:12 +00:00
Wrap search type enablement status in a search settings class
- Cleaner, more idiomatic usage of a global variable - Simplifies mocking when testing client in pytest as setting wrapped in object rather than a simple type. So passed around by reference
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
# System Packages
|
||||
from enum import Enum
|
||||
from dataclasses import dataclass
|
||||
|
||||
|
||||
class SearchType(str, Enum):
|
||||
@@ -7,3 +9,12 @@ class SearchType(str, Enum):
|
||||
Music = "music"
|
||||
Image = "image"
|
||||
|
||||
|
||||
@dataclass
|
||||
class SearchSettings():
|
||||
notes_search_enabled: bool = False
|
||||
ledger_search_enabled: bool = False
|
||||
music_search_enabled: bool = False
|
||||
image_search_enabled: bool = False
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user