mirror of
https://github.com/Jellify-Music/App.git
synced 2026-05-05 02:09:32 -05:00
carplay fixes
This commit is contained in:
@@ -21,14 +21,14 @@ const CarPlayHome : ListTemplate = new ListTemplate({
|
||||
onItemSelect: async ({ index }) => {
|
||||
|
||||
switch (index) {
|
||||
case 1:
|
||||
case 0:
|
||||
|
||||
break;
|
||||
case 2:
|
||||
case 1:
|
||||
const tracks = await fetchRecentlyPlayed()
|
||||
CarPlay.pushTemplate(CarPlayRecentlyPlayed(tracks))
|
||||
break;
|
||||
case 3:
|
||||
case 2:
|
||||
|
||||
break;
|
||||
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { getImageFilePath } from "../../api/queries/functions/images";
|
||||
import Client from "../../api/client";
|
||||
import { BaseItemDto } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
import { BaseItemDto, ImageType } from "@jellyfin/sdk/lib/generated-client/models";
|
||||
import { getImageApi } from "@jellyfin/sdk/lib/utils/api";
|
||||
import { GridTemplate, ListTemplate } from "react-native-carplay";
|
||||
|
||||
@@ -9,9 +10,9 @@ export const CarPlayRecentlyPlayed = (recentTracks : BaseItemDto[]) => new ListT
|
||||
return {
|
||||
id: track.Id!,
|
||||
text: track.Name ? track.Name : "Untitled Track",
|
||||
imgUrls : [
|
||||
Client.api ? getImageApi(Client.api).getItemImageUrlById(track.Id!) : ""
|
||||
]
|
||||
image: {
|
||||
uri: `file://${getImageFilePath(track.Id!, 150, 150, ImageType.Primary)}`
|
||||
}
|
||||
}
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user