mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-04-03 07:31:53 +01:00
refactor: remove unused code and simplify implementations
Removes extensive dead code including unused components, utilities, and augmentations that were no longer referenced in the codebase. Simplifies play settings logic by removing complex stream ranking algorithm in favor of direct previous index matching for audio and subtitle selections. Removes aspectRatio prop from video player as it was set to a constant "default" value and never changed. Inlines POSTER_CAROUSEL_HEIGHT constant directly where used instead of importing from centralized constants file. Eliminates unused features including image color extraction for TV platforms, M3U8 subtitle parsing, and various Jellyfin API helpers that were no longer needed. Cleans up credential management by making internal helper functions private that should not be exposed to external consumers.
This commit is contained in:
@@ -76,9 +76,9 @@ interface LegacyServerCredential {
|
||||
}
|
||||
|
||||
/**
|
||||
* Encode server URL to valid secure store key (legacy, for migration).
|
||||
* Generate a unique key for a server URL (for secure storage).
|
||||
*/
|
||||
export function serverUrlToKey(serverUrl: string): string {
|
||||
function serverUrlToKey(serverUrl: string): string {
|
||||
const encoded = btoa(serverUrl).replace(/[^a-zA-Z0-9]/g, "_");
|
||||
return `${CREDENTIAL_KEY_PREFIX}${encoded}`;
|
||||
}
|
||||
@@ -86,7 +86,7 @@ export function serverUrlToKey(serverUrl: string): string {
|
||||
/**
|
||||
* Generate credential key for a specific account (serverUrl + userId).
|
||||
*/
|
||||
export function credentialKey(serverUrl: string, userId: string): string {
|
||||
function credentialKey(serverUrl: string, userId: string): string {
|
||||
const combined = `${serverUrl}:${userId}`;
|
||||
const encoded = btoa(combined).replace(/[^a-zA-Z0-9]/g, "_");
|
||||
return `${CREDENTIAL_KEY_PREFIX}${encoded}`;
|
||||
@@ -200,10 +200,7 @@ export async function hasAccountCredential(
|
||||
return stored !== null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete all credentials for all accounts on all servers.
|
||||
*/
|
||||
export async function clearAllCredentials(): Promise<void> {
|
||||
async function _clearAllCredentials(): Promise<void> {
|
||||
const previousServers = getPreviousServers();
|
||||
|
||||
for (const server of previousServers) {
|
||||
|
||||
Reference in New Issue
Block a user