Skip to content

Commit

Permalink
Merge pull request #352 from thornbill/ancient-servers
Browse files Browse the repository at this point in the history
Remove support for server versions <10.3
  • Loading branch information
thornbill authored Mar 22, 2022
2 parents 3015e6f + 7500996 commit 1404a32
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
12 changes: 0 additions & 12 deletions utils/ServerValidator.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,18 +88,6 @@ export const validateServer = async (server = {}) => {

try {
const responseJson = await fetchServerInfo(server);

// Versions prior to 10.3.x do not include ProductName so return true if response
// includes Version < 10.3.x and has an Id
if (responseJson.Version) {
const versionNumber = responseJson.Version.split('.').map(num => Number.parseInt(num, 10));
if (versionNumber.length === 3 && versionNumber[0] === 10 && versionNumber[1] < 3) {
const isValid = responseJson.Id?.length > 0;
console.log('Is valid old version', isValid);
return { isValid };
}
}

const isValid = responseJson.ProductName === 'Jellyfin Server';
const answer = {
isValid
Expand Down
7 changes: 0 additions & 7 deletions utils/__tests__/ServerValidator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,6 @@ describe('ServerValidator', () => {
expect(result.message).toBe('invalid');
});

it('should return valid for 10.2.x servers', async () => {
fetch.mockResponse(JSON.stringify({ Id: 'test', Version: '10.2.0' }));

const result = await validateServer({ url: new URL('https://foobar/') });
expect(result.isValid).toBe(true);
});

it('should return valid if product name is "Jellyfin Server"', async () => {
fetch.mockResponse(JSON.stringify({ ProductName: 'Jellyfin Server' }));

Expand Down

0 comments on commit 1404a32

Please sign in to comment.