From 4aae3d2ba7fd3ffec93de9ca0ca43e50479f5fdf Mon Sep 17 00:00:00 2001 From: Matthew Haughton <3flex@users.noreply.github.com> Date: Sun, 10 Nov 2024 22:48:07 +1100 Subject: [PATCH] Remove unused createUserUrl function --- src/components/__tests__/jellyfinApi.test.ts | 37 -------------------- src/components/jellyfinApi.ts | 14 -------- 2 files changed, 51 deletions(-) diff --git a/src/components/__tests__/jellyfinApi.test.ts b/src/components/__tests__/jellyfinApi.test.ts index b04a4e62..c0eb2287 100644 --- a/src/components/__tests__/jellyfinApi.test.ts +++ b/src/components/__tests__/jellyfinApi.test.ts @@ -52,43 +52,6 @@ describe('creating basic urls', () => { }); }); -describe('creating user urls', () => { - beforeAll(() => { - setupMockCastSenders(); - }); - - beforeEach(() => { - JellyfinApi.setServerInfo( - 'thisIsUserId', - 'thisIsAccessToken', - 'thisIsServerAddress' - ); - }); - - test('should return correct url', () => { - const result = JellyfinApi.createUserUrl('somePath'); - const correct = 'thisIsServerAddress/Users/thisIsUserId/somePath'; - - expect(result).toEqual(correct); - }); - - test('should remove leading slashes', () => { - const result = JellyfinApi.createUserUrl('////////somePath'); - const correct = 'thisIsServerAddress/Users/thisIsUserId/somePath'; - - expect(result).toEqual(correct); - }); - - test('should return empty string on undefined serverAddress', () => { - JellyfinApi.setServerInfo(); - - const result = JellyfinApi.createUserUrl('somePath'); - const correct = ''; - - expect(result).toEqual(correct); - }); -}); - describe('creating image urls', () => { beforeAll(() => { setupMockCastSenders(); diff --git a/src/components/jellyfinApi.ts b/src/components/jellyfinApi.ts index 410ac172..859b02e4 100644 --- a/src/components/jellyfinApi.ts +++ b/src/components/jellyfinApi.ts @@ -125,20 +125,6 @@ export abstract class JellyfinApi { return `${this.serverAddress}/${path}`; } - // create a path in /Users/userId/ - public static createUserUrl(path: string | null = null): string { - if (path) { - // Remove leading slashes - while (path.startsWith('/')) { - path = path.substring(1); - } - - return this.createUrl(`Users/${this.userId}/${path}`); - } else { - return this.createUrl(`Users/${this.userId}`); - } - } - /** * Create url to image * @param itemId - Item id