mirror of
https://github.com/tapframe/NuvioStreaming.git
synced 2026-03-22 18:47:44 +00:00
Merge branch 'patch-25'
This commit is contained in:
commit
e8accae46f
3 changed files with 23 additions and 7 deletions
|
|
@ -125,9 +125,15 @@ export const useMetadata = ({ id, type, addonId }: UseMetadataProps): UseMetadat
|
|||
|
||||
// Normalize anime subtypes to their base types for all internal logic.
|
||||
// anime.series behaves like series; anime.movie behaves like movie.
|
||||
const normalizedType = type === 'anime.series' ? 'series'
|
||||
: type === 'anime.movie' ? 'movie'
|
||||
: type;
|
||||
// Lowercase first — some addons use capitalized types (e.g. "Movie", "Series", "Other")
|
||||
// which would break all type comparisons downstream.
|
||||
const lowercasedType = type ? type.toLowerCase() : type;
|
||||
|
||||
// Normalize anime subtypes to their base types for all internal logic.
|
||||
// anime.series behaves like series; anime.movie behaves like movie.
|
||||
const normalizedType = lowercasedType === 'anime.series' ? 'series'
|
||||
: lowercasedType === 'anime.movie' ? 'movie'
|
||||
: lowercasedType;
|
||||
|
||||
const [metadata, setMetadata] = useState<StreamingContent | null>(null);
|
||||
const [loading, setLoading] = useState(true);
|
||||
|
|
|
|||
|
|
@ -321,9 +321,19 @@ async function searchAddonCatalog(
|
|||
|
||||
const items = metas.map(meta => {
|
||||
const content = convertMetaToStreamingContent(meta, library);
|
||||
content.addonId = manifest.id;
|
||||
if (type && content.type !== type) {
|
||||
content.type = type;
|
||||
const addonSupportsMeta = Array.isArray(manifest.resources) && manifest.resources.some((resource: any) =>
|
||||
resource === 'meta' || (typeof resource === 'object' && resource?.name === 'meta')
|
||||
);
|
||||
|
||||
if (addonSupportsMeta) {
|
||||
content.addonId = manifest.id;
|
||||
}
|
||||
|
||||
const normalizedCatalogType = type ? type.toLowerCase() : type;
|
||||
if (normalizedCatalogType && content.type !== normalizedCatalogType) {
|
||||
content.type = normalizedCatalogType;
|
||||
} else if (content.type) {
|
||||
content.type = content.type.toLowerCase();
|
||||
}
|
||||
return content;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -104,7 +104,7 @@ class CatalogService implements CatalogLibraryState {
|
|||
return getCatalogByType(this.library, dataSourcePreference, type, genreFilter);
|
||||
}
|
||||
|
||||
async getDataSourcePreference() {
|
||||
async getDataSourcePreference(): Promise<DataSource> {
|
||||
return getDataSourcePreference();
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue