Revert "Merge pull request 'ui-update' (#1) from ui-update into main"
This reverts commitc9135c617b, reversing changes made to0f181833e5.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
import { onMount, tick } from "svelte";
|
||||
import { API, apiFetch } from "../utils/api.js";
|
||||
import { cleanFileName } from "../utils/filename.js";
|
||||
import { tvShowRefreshVersion } from "../stores/tvStore.js";
|
||||
import { tvShowCount } from "../stores/tvStore.js";
|
||||
import {
|
||||
activeSearchTerm,
|
||||
setSearchScope
|
||||
@@ -13,8 +13,6 @@
|
||||
let refreshing = false;
|
||||
let rescanning = false;
|
||||
let error = null;
|
||||
let mounted = false;
|
||||
let unsubscribeVersion = null;
|
||||
|
||||
let selectedShow = null;
|
||||
let selectedSeason = null;
|
||||
@@ -190,9 +188,11 @@ let filteredShows = [];
|
||||
if (!resp.ok) throw new Error(`HTTP ${resp.status}`);
|
||||
const list = await resp.json();
|
||||
shows = Array.isArray(list) ? list.map(normalizeShow) : [];
|
||||
tvShowCount.set(shows.length);
|
||||
} catch (err) {
|
||||
error = err?.message || "TV dizileri alınamadı.";
|
||||
shows = [];
|
||||
tvShowCount.set(0);
|
||||
} finally {
|
||||
loading = false;
|
||||
}
|
||||
@@ -251,21 +251,6 @@ let filteredShows = [];
|
||||
}
|
||||
}
|
||||
|
||||
onMount(() => {
|
||||
mounted = true;
|
||||
loadShows();
|
||||
unsubscribeVersion = tvShowRefreshVersion.subscribe((ver) => {
|
||||
if (!mounted) return;
|
||||
if (loading || refreshing || rescanning) return;
|
||||
if (ver === null) return;
|
||||
loadShows();
|
||||
});
|
||||
return () => {
|
||||
mounted = false;
|
||||
unsubscribeVersion && unsubscribeVersion();
|
||||
};
|
||||
});
|
||||
|
||||
function openShow(show) {
|
||||
if (!show) return;
|
||||
selectedShow = show;
|
||||
|
||||
Reference in New Issue
Block a user