Fix warnings and update tracability
This commit is contained in:
@@ -17,6 +17,7 @@ vi.mock("@tauri-apps/api/core", () => ({
|
||||
return {
|
||||
enabled: true,
|
||||
countdownSeconds: 10,
|
||||
maxEpisodes: 5,
|
||||
};
|
||||
}
|
||||
if (command === "player_set_autoplay_settings") {
|
||||
@@ -61,6 +62,7 @@ describe("autoplay API", () => {
|
||||
const settings: AutoplaySettings = {
|
||||
enabled: true,
|
||||
countdownSeconds: 15,
|
||||
maxEpisodes: 5,
|
||||
};
|
||||
|
||||
const result = await setAutoplaySettings(settings);
|
||||
@@ -72,6 +74,7 @@ describe("autoplay API", () => {
|
||||
const settings: AutoplaySettings = {
|
||||
enabled: false,
|
||||
countdownSeconds: 10,
|
||||
maxEpisodes: 5,
|
||||
};
|
||||
|
||||
const result = await setAutoplaySettings(settings);
|
||||
@@ -86,6 +89,7 @@ describe("autoplay API", () => {
|
||||
const settings: AutoplaySettings = {
|
||||
enabled: true,
|
||||
countdownSeconds: 20,
|
||||
maxEpisodes: 5,
|
||||
};
|
||||
|
||||
await setAutoplaySettings(settings);
|
||||
@@ -104,6 +108,7 @@ describe("autoplay API", () => {
|
||||
const settings: AutoplaySettings = {
|
||||
enabled: true,
|
||||
countdownSeconds: countdown,
|
||||
maxEpisodes: 5,
|
||||
};
|
||||
|
||||
const result = await setAutoplaySettings(settings);
|
||||
|
||||
@@ -350,7 +350,7 @@ describe("Backend Integration - Refactored Business Logic", () => {
|
||||
const backendUrl = "https://server.com/Videos/item123/stream.mp4?maxWidth=1280&api_key=token";
|
||||
(invoke as any).mockResolvedValueOnce(backendUrl);
|
||||
|
||||
const url = await client.getVideoDownloadUrl("item123", "720p");
|
||||
const url = await client.getVideoDownloadUrl("item123", "medium");
|
||||
|
||||
expect(url).toBe(backendUrl);
|
||||
expect(invoke).toHaveBeenCalledWith(
|
||||
@@ -454,8 +454,8 @@ describe("Backend Integration - Refactored Business Logic", () => {
|
||||
it("should support complete flow: load → sort → display", async () => {
|
||||
(invoke as any).mockResolvedValueOnce({
|
||||
items: [
|
||||
{ id: "id1", name: "Album A", sortName: "A" },
|
||||
{ id: "id2", name: "Album B", sortName: "B" },
|
||||
{ id: "id1", name: "Album A" },
|
||||
{ id: "id2", name: "Album B" },
|
||||
],
|
||||
totalRecordCount: 2,
|
||||
});
|
||||
@@ -467,8 +467,8 @@ describe("Backend Integration - Refactored Business Logic", () => {
|
||||
});
|
||||
|
||||
// Backend returned pre-sorted items
|
||||
expect(result.items[0].sortName).toBe("A");
|
||||
expect(result.items[1].sortName).toBe("B");
|
||||
expect(result.items[0].name).toBe("Album A");
|
||||
expect(result.items[1].name).toBe("Album B");
|
||||
|
||||
// Frontend just displays them
|
||||
// No compareFn, no local sorting
|
||||
|
||||
@@ -202,13 +202,13 @@ describe("RepositoryClient", () => {
|
||||
const mockUrl = "https://server.com/Videos/item123/stream.mp4?maxWidth=1920&api_key=token";
|
||||
(invoke as any).mockResolvedValueOnce(mockUrl);
|
||||
|
||||
const downloadUrl = await client.getVideoDownloadUrl("item123", "1080p");
|
||||
const downloadUrl = await client.getVideoDownloadUrl("item123", "high");
|
||||
|
||||
expect(downloadUrl).toBe(mockUrl);
|
||||
expect(invoke).toHaveBeenCalledWith("repository_get_video_download_url", {
|
||||
handle: "test-handle-123",
|
||||
itemId: "item123",
|
||||
quality: "1080p",
|
||||
quality: "high",
|
||||
mediaSourceId: null,
|
||||
});
|
||||
});
|
||||
@@ -228,7 +228,7 @@ describe("RepositoryClient", () => {
|
||||
});
|
||||
|
||||
it("should support quality presets", async () => {
|
||||
const qualities = ["original", "1080p", "720p", "480p"];
|
||||
const qualities = ["original", "high", "medium", "low"];
|
||||
|
||||
for (const quality of qualities) {
|
||||
vi.clearAllMocks();
|
||||
@@ -252,12 +252,12 @@ describe("RepositoryClient", () => {
|
||||
const mockUrl = "https://server.com/Videos/item123/stream.mp4?api_key=token";
|
||||
(invoke as any).mockResolvedValueOnce(mockUrl);
|
||||
|
||||
await client.getVideoDownloadUrl("item123", "720p", "source789");
|
||||
await client.getVideoDownloadUrl("item123", "medium", "source789");
|
||||
|
||||
expect(invoke).toHaveBeenCalledWith("repository_get_video_download_url", {
|
||||
handle: expect.any(String),
|
||||
itemId: "item123",
|
||||
quality: "720p",
|
||||
quality: "medium",
|
||||
mediaSourceId: "source789",
|
||||
});
|
||||
});
|
||||
|
||||
@@ -67,6 +67,9 @@ export interface MediaItem {
|
||||
|
||||
// Cast & Crew
|
||||
people?: Person[];
|
||||
|
||||
// Genres
|
||||
genres?: string[];
|
||||
}
|
||||
|
||||
export type ItemType =
|
||||
|
||||
Reference in New Issue
Block a user