mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-05-26 16:56:39 +01:00
chore: cleanup (#1565)
This commit is contained in:
@@ -186,7 +186,7 @@ const page: React.FC = () => {
|
|||||||
genres: selectedGenres,
|
genres: selectedGenres,
|
||||||
tags: selectedTags,
|
tags: selectedTags,
|
||||||
years: selectedYears.map((year) => Number.parseInt(year, 10)),
|
years: selectedYears.map((year) => Number.parseInt(year, 10)),
|
||||||
includeItemTypes: ["Movie", "Series"],
|
includeItemTypes: ["Movie", "Series", "Season"],
|
||||||
});
|
});
|
||||||
|
|
||||||
return response.data || null;
|
return response.data || null;
|
||||||
|
|||||||
@@ -20,10 +20,7 @@ import { useTranslation } from "react-i18next";
|
|||||||
import {
|
import {
|
||||||
ActivityIndicator,
|
ActivityIndicator,
|
||||||
Animated,
|
Animated,
|
||||||
Dimensions,
|
|
||||||
Easing,
|
Easing,
|
||||||
PixelRatio,
|
|
||||||
Platform,
|
|
||||||
ScrollView,
|
ScrollView,
|
||||||
View,
|
View,
|
||||||
} from "react-native";
|
} from "react-native";
|
||||||
@@ -83,22 +80,6 @@ export const Home = () => {
|
|||||||
const _invalidateCache = useInvalidatePlaybackProgressCache();
|
const _invalidateCache = useInvalidatePlaybackProgressCache();
|
||||||
const { showItemActions } = useTVItemActionModal();
|
const { showItemActions } = useTVItemActionModal();
|
||||||
|
|
||||||
// Log TV viewport dimensions for DPI scaling debug
|
|
||||||
useEffect(() => {
|
|
||||||
const w = Dimensions.get("window");
|
|
||||||
const s = Dimensions.get("screen");
|
|
||||||
console.log("========== TV DIMENSIONS ==========");
|
|
||||||
console.log("Platform.OS:", Platform.OS, "isTV:", Platform.isTV);
|
|
||||||
console.log("Window:", w.width, "x", w.height);
|
|
||||||
console.log("Screen:", s.width, "x", s.height);
|
|
||||||
console.log("PixelRatio:", PixelRatio.get());
|
|
||||||
console.log(
|
|
||||||
"scaleSize(210):",
|
|
||||||
210 * Math.min(w.width / 1920, w.height / 1080),
|
|
||||||
);
|
|
||||||
console.log("====================================");
|
|
||||||
}, []);
|
|
||||||
|
|
||||||
// Dynamic backdrop state with debounce
|
// Dynamic backdrop state with debounce
|
||||||
const [focusedItem, setFocusedItem] = useState<BaseItemDto | null>(null);
|
const [focusedItem, setFocusedItem] = useState<BaseItemDto | null>(null);
|
||||||
const debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
const debounceTimerRef = useRef<ReturnType<typeof setTimeout> | null>(null);
|
||||||
|
|||||||
@@ -246,7 +246,7 @@ export const TVLogin: React.FC = () => {
|
|||||||
setCurrentScreen("user-selection");
|
setCurrentScreen("user-selection");
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[TVLogin] Error in handleConnect:", error);
|
if (__DEV__) console.error("[TVLogin] Error in handleConnect:", error);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
[checkUrl, setServer, serverName, setSelectedTVServer],
|
[checkUrl, setServer, serverName, setSelectedTVServer],
|
||||||
@@ -485,10 +485,11 @@ export const TVLogin: React.FC = () => {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
} catch (saveError) {
|
} catch (saveError) {
|
||||||
console.error(
|
if (__DEV__)
|
||||||
"[TVLogin] Failed to save pairing credential:",
|
console.error(
|
||||||
saveError,
|
"[TVLogin] Failed to save pairing credential:",
|
||||||
);
|
saveError,
|
||||||
|
);
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
const message =
|
const message =
|
||||||
@@ -589,7 +590,7 @@ export const TVLogin: React.FC = () => {
|
|||||||
pairingCode,
|
pairingCode,
|
||||||
handlePairingCredentials,
|
handlePairingCredentials,
|
||||||
(error) => {
|
(error) => {
|
||||||
console.error("[TVLogin] Pairing error:", error);
|
if (__DEV__) console.error("[TVLogin] Pairing error:", error);
|
||||||
setShowPairingQR(false);
|
setShowPairingQR(false);
|
||||||
Alert.alert(t("login.error_title"), t("companion_login.error_generic"));
|
Alert.alert(t("login.error_title"), t("companion_login.error_generic"));
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -27,13 +27,14 @@ export function startPairingListener(
|
|||||||
});
|
});
|
||||||
|
|
||||||
socket.on("error", (err) => {
|
socket.on("error", (err) => {
|
||||||
console.error("[PairingService] Socket error:", err);
|
if (__DEV__) console.error("[PairingService] Socket error:", err);
|
||||||
onError?.(err.message);
|
onError?.(err.message);
|
||||||
cleanup();
|
cleanup();
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.bind(PAIRING_PORT, () => {
|
socket.bind(PAIRING_PORT, () => {
|
||||||
console.log("[PairingService] Listening on port", PAIRING_PORT);
|
if (__DEV__)
|
||||||
|
console.log("[PairingService] Listening on port", PAIRING_PORT);
|
||||||
});
|
});
|
||||||
|
|
||||||
socket.on("message", (msg) => {
|
socket.on("message", (msg) => {
|
||||||
@@ -46,11 +47,11 @@ export function startPairingListener(
|
|||||||
if (data.code !== code) return;
|
if (data.code !== code) return;
|
||||||
|
|
||||||
if (!data.server_url || !data.username || !data.password) {
|
if (!data.server_url || !data.username || !data.password) {
|
||||||
console.error("[PairingService] Missing fields in pairing response");
|
if (__DEV__)
|
||||||
|
console.error("[PairingService] Missing fields in pairing response");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
console.log("[PairingService] Credentials received");
|
|
||||||
active = false;
|
active = false;
|
||||||
onCredentialsReceived({
|
onCredentialsReceived({
|
||||||
serverUrl: data.server_url,
|
serverUrl: data.server_url,
|
||||||
@@ -59,7 +60,8 @@ export function startPairingListener(
|
|||||||
});
|
});
|
||||||
cleanup();
|
cleanup();
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("[PairingService] Error parsing message:", error);
|
if (__DEV__)
|
||||||
|
console.error("[PairingService] Error parsing message:", error);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user