mirror of
https://github.com/ksyasuda/SubMiner.git
synced 2026-09-22 05:16:22 -07:00
fix(anime): scope preferences, paginate sources, harden installs
- Preference store keys entries by extension package + bridge source id; legacy unscoped entries are discarded once instead of being handed to whichever extension asks first - Source picker's "Load more" appends the next page without duplicating streamed results - Repository index fetches and subtitle/APK downloads now time out and are size-bounded instead of hanging or growing unbounded - APK installs are staged to a temp file and renamed into place - Stream metadata lookup matches the requested path, not only the currently playing one - Reworked animeui into browse-state/detail-panel/panels.css modules - Reverted premature CHANGELOG unreleased entries; refreshed anime-browser docs
This commit is contained in:
@@ -41,6 +41,18 @@ export function createStreamPlaybackMetadataStore(): StreamPlaybackMetadataStore
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* Match metadata for the path a caller requested, falling back to the active
|
||||
* player path only when the caller has no path of its own.
|
||||
*/
|
||||
export function matchRequestedStreamPlaybackMetadata(
|
||||
store: StreamPlaybackMetadataStore,
|
||||
requestedMediaPath: string | null,
|
||||
currentMediaPath: string | null,
|
||||
): AnimeStreamMetadata | null {
|
||||
return store.match(requestedMediaPath ?? currentMediaPath);
|
||||
}
|
||||
|
||||
/** AniList counts whole episodes, so a special numbered 6.5 cannot drive it. */
|
||||
function wholeEpisode(episode: number | null): number | null {
|
||||
return typeof episode === 'number' && Number.isInteger(episode) && episode > 0 ? episode : null;
|
||||
@@ -52,11 +64,12 @@ function wholeEpisode(episode: number | null): number | null {
|
||||
* modals may search on them without waiting for the user to confirm.
|
||||
*/
|
||||
export function toJimakuMediaInfo(metadata: AnimeStreamMetadata): JimakuMediaInfo {
|
||||
const episode = wholeEpisode(metadata.episodeNumber);
|
||||
return {
|
||||
title: metadata.seriesTitle,
|
||||
season: metadata.seasonNumber,
|
||||
episode: wholeEpisode(metadata.episodeNumber),
|
||||
confidence: metadata.episodeNumber !== null ? 'high' : 'low',
|
||||
episode,
|
||||
confidence: episode !== null ? 'high' : 'low',
|
||||
filename: metadata.displayTitle,
|
||||
rawTitle: metadata.displayTitle,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user