mirror of
https://github.com/streamyfin/streamyfin.git
synced 2026-07-16 01:13:27 +01:00
revert: remove accidentally merged ios widget commits
Reverts commits d58c1a77 (feat: ios widget) and 08fe871d (wip: widget) that were accidentally merged from feat/ios-widget-build-target branch.
This commit is contained in:
@@ -1,4 +1,3 @@
|
||||
import { ExtensionStorage } from "@bacons/apple-targets";
|
||||
import type { Api } from "@jellyfin/sdk";
|
||||
import type {
|
||||
BaseItemDto,
|
||||
@@ -16,7 +15,6 @@ import React, {
|
||||
useRef,
|
||||
useState,
|
||||
} from "react";
|
||||
import { Platform } from "react-native";
|
||||
import TrackPlayer, {
|
||||
Capability,
|
||||
type Progress,
|
||||
@@ -35,12 +33,6 @@ import { settingsAtom } from "@/utils/atoms/settings";
|
||||
import { getAudioStreamUrl } from "@/utils/jellyfin/audio/getAudioStreamUrl";
|
||||
import { storage } from "@/utils/mmkv";
|
||||
|
||||
// Widget storage for iOS
|
||||
const widgetStorage =
|
||||
Platform.OS === "ios"
|
||||
? new ExtensionStorage("group.com.fredrikburmester.streamyfin.widgets")
|
||||
: null;
|
||||
|
||||
// Storage keys
|
||||
const STORAGE_KEYS = {
|
||||
QUEUE: "music_player_queue",
|
||||
@@ -396,38 +388,6 @@ export const MusicPlayerProvider: React.FC<MusicPlayerProviderProps> = ({
|
||||
}
|
||||
}, [state.progress, state.currentTrack]);
|
||||
|
||||
// Sync now playing data to iOS widget
|
||||
useEffect(() => {
|
||||
if (!widgetStorage) return;
|
||||
|
||||
if (state.currentTrack && api) {
|
||||
const albumId = state.currentTrack.AlbumId || state.currentTrack.ParentId;
|
||||
const artworkId = albumId || state.currentTrack.Id;
|
||||
const artworkUrl = artworkId
|
||||
? `${api.basePath}/Items/${artworkId}/Images/Primary?maxHeight=300`
|
||||
: null;
|
||||
|
||||
widgetStorage.set(
|
||||
"nowPlaying",
|
||||
JSON.stringify({
|
||||
title: state.currentTrack.Name || "Unknown Track",
|
||||
artist:
|
||||
state.currentTrack.Artists?.join(", ") ||
|
||||
state.currentTrack.AlbumArtist ||
|
||||
"Unknown Artist",
|
||||
album: state.currentTrack.Album || "",
|
||||
artworkUrl,
|
||||
isPlaying: state.isPlaying,
|
||||
updatedAt: Date.now(),
|
||||
}),
|
||||
);
|
||||
ExtensionStorage.reloadWidget();
|
||||
} else {
|
||||
widgetStorage.set("nowPlaying", undefined);
|
||||
ExtensionStorage.reloadWidget();
|
||||
}
|
||||
}, [state.currentTrack?.Id, state.isPlaying, api]);
|
||||
|
||||
const reportPlaybackStart = useCallback(
|
||||
async (track: BaseItemDto, sessionId: string | null) => {
|
||||
if (!api || !user?.Id || !track.Id) return;
|
||||
|
||||
Reference in New Issue
Block a user