mirror of
https://github.com/Viren070/MediaFusion.git
synced 2025-12-01 23:21:11 +01:00
Improve stream sorting with direction toggle feature
Enhanced the stream sorting functionality to support sorting direction (ascending or descending) based on user preferences in both the backend and UI. Introduced 'SortingOption' in the schema to capture sorting criteria with direction, and updated the sorting logic to accommodate these changes. Additionally, modified the user interface to include buttons for toggling sort directions, providing a more intuitive sorting experience for users.
This commit is contained in:
+3
-2
@@ -25,6 +25,7 @@ from api import middleware
|
||||
from api.scheduler import setup_scheduler
|
||||
from db import crud, database, schemas
|
||||
from db.config import settings
|
||||
from db.schemas import SortingOption
|
||||
from kodi.routes import kodi_router
|
||||
from metrics.routes import metrics_router
|
||||
from scrapers.routes import router as scrapers_router
|
||||
@@ -183,9 +184,9 @@ async def configure(
|
||||
)
|
||||
|
||||
sorted_sorting_options = user_data.torrent_sorting_priority + [
|
||||
option
|
||||
SortingOption(key=option)
|
||||
for option in const.TORRENT_SORTING_PRIORITY_OPTIONS
|
||||
if option not in user_data.torrent_sorting_priority
|
||||
if not user_data.is_sorting_option_present(option)
|
||||
]
|
||||
|
||||
# Sort languages based on user preference
|
||||
|
||||
Reference in New Issue
Block a user