feat: Emby support (#234)

* fix: support credential extraction from Emby

* fix: minor compatibility with emby for retrieving albums

* fix: rename credentials and save credentials type

* fix: weird issue when changing libraries

* fix: correctly map platform names in auth header

* chore: properly carry over old settings

* fix: only enable playlists on jellyfin

* fix: remove jellyfin mentions

* fix: incorporate jellyfin and emby as mentions
This commit is contained in:
Lei Nelissen
2024-07-25 23:37:00 +02:00
committed by GitHub
parent c15f8fe1fc
commit a6452f0a5e
35 changed files with 294 additions and 168 deletions

View File

@@ -32,6 +32,7 @@ const HeaderContainer = styled.View`
`;
const NavigationHeader: React.FC = () => {
const type = useTypedSelector((state) => state.settings.credentials?.type);
const navigation = useNavigation<NavigationProp>();
const handleAllAlbumsClick = useCallback(() => { navigation.navigate('Albums'); }, [navigation]);
const handlePlaylistsClick = useCallback(() => { navigation.navigate('Playlists'); }, [navigation]);
@@ -39,9 +40,17 @@ const NavigationHeader: React.FC = () => {
return (
<>
<ListButton onPress={handleAllAlbumsClick} testID="all-albums">{t('all-albums')}</ListButton>
<ListButton onPress={handleArtistsClick} testID="artists">{t('artists')}</ListButton>
<ListButton onPress={handlePlaylistsClick} testID="playlists">{t('playlists')}</ListButton>
<ListButton onPress={handleAllAlbumsClick} testID="all-albums">
{t('all-albums')}
</ListButton>
<ListButton onPress={handleArtistsClick} testID="artists">
{t('artists')}
</ListButton>
{type === 'jellyfin' && (
<ListButton onPress={handlePlaylistsClick} testID="playlists">
{t('playlists')}
</ListButton>
)}
<ListContainer>
<HeaderContainer>
<Header>{t('recent-albums')}</Header>

View File

@@ -114,7 +114,7 @@ const TrackListView: React.FC<TrackListViewProps> = ({
return [['0', trackIds]];
}
const groups = groupBy(trackIds, (id) => tracks[id].ParentIndexNumber);
const groups = groupBy(trackIds, (id) => tracks[id]?.ParentIndexNumber);
return Object.entries(groups);
}, [trackIds, tracks, listNumberingStyle]);