Split software arch desc for easier manintenance. Many fixes related to next video playing and remote playback
This commit is contained in:
@@ -15,6 +15,8 @@ import type {
|
||||
ImageType,
|
||||
ImageOptions,
|
||||
Genre,
|
||||
PlaylistEntry,
|
||||
PlaylistCreatedResult,
|
||||
} from "./types";
|
||||
|
||||
/**
|
||||
@@ -305,6 +307,63 @@ export class RepositoryClient {
|
||||
});
|
||||
}
|
||||
|
||||
// ===== Playlist Methods (via Rust) =====
|
||||
|
||||
async createPlaylist(name: string, itemIds?: string[]): Promise<PlaylistCreatedResult> {
|
||||
return invoke<PlaylistCreatedResult>("playlist_create", {
|
||||
handle: this.ensureHandle(),
|
||||
name,
|
||||
itemIds: itemIds ?? null,
|
||||
});
|
||||
}
|
||||
|
||||
async deletePlaylist(playlistId: string): Promise<void> {
|
||||
return invoke("playlist_delete", {
|
||||
handle: this.ensureHandle(),
|
||||
playlistId,
|
||||
});
|
||||
}
|
||||
|
||||
async renamePlaylist(playlistId: string, name: string): Promise<void> {
|
||||
return invoke("playlist_rename", {
|
||||
handle: this.ensureHandle(),
|
||||
playlistId,
|
||||
name,
|
||||
});
|
||||
}
|
||||
|
||||
async getPlaylistItems(playlistId: string): Promise<PlaylistEntry[]> {
|
||||
return invoke<PlaylistEntry[]>("playlist_get_items", {
|
||||
handle: this.ensureHandle(),
|
||||
playlistId,
|
||||
});
|
||||
}
|
||||
|
||||
async addToPlaylist(playlistId: string, itemIds: string[]): Promise<void> {
|
||||
return invoke("playlist_add_items", {
|
||||
handle: this.ensureHandle(),
|
||||
playlistId,
|
||||
itemIds,
|
||||
});
|
||||
}
|
||||
|
||||
async removeFromPlaylist(playlistId: string, entryIds: string[]): Promise<void> {
|
||||
return invoke("playlist_remove_items", {
|
||||
handle: this.ensureHandle(),
|
||||
playlistId,
|
||||
entryIds,
|
||||
});
|
||||
}
|
||||
|
||||
async movePlaylistItem(playlistId: string, itemId: string, newIndex: number): Promise<void> {
|
||||
return invoke("playlist_move_item", {
|
||||
handle: this.ensureHandle(),
|
||||
playlistId,
|
||||
itemId,
|
||||
newIndex,
|
||||
});
|
||||
}
|
||||
|
||||
// ===== Getters =====
|
||||
|
||||
get serverUrl(): string {
|
||||
|
||||
Reference in New Issue
Block a user