Merge branch 'patch-25'

This commit is contained in:
tapframe 2026-03-17 07:02:45 +05:30
commit e8accae46f
3 changed files with 23 additions and 7 deletions

View file

@ -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);

View file

@ -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;
});

View file

@ -104,7 +104,7 @@ class CatalogService implements CatalogLibraryState {
return getCatalogByType(this.library, dataSourcePreference, type, genreFilter);
}
async getDataSourcePreference() {
async getDataSourcePreference(): Promise<DataSource> {
return getDataSourcePreference();
}