Skip to content

Commit

Permalink
Remove "RECEIVERVERSION" global
Browse files Browse the repository at this point in the history
  • Loading branch information
nielsvanvelzen committed Oct 3, 2023
1 parent c2ac063 commit 1e2f4f6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 13 deletions.
11 changes: 3 additions & 8 deletions src/components/jellyfinApi.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { ajax } from './fetchhelper';
import { version as packageVersion } from '../../package.json';

Check failure on line 2 in src/components/jellyfinApi.ts

View workflow job for this annotation

GitHub Actions / Lint TS and CSS

`../../package.json` import should occur before import of `./fetchhelper`

export abstract class JellyfinApi {
// userId that we are connecting as currently
Expand All @@ -16,9 +17,6 @@ export abstract class JellyfinApi {
// unique id
public static deviceId = '';

// version
public static versionNumber = RECEIVERVERSION;

public static setServerInfo(
userId?: string,
accessToken?: string,
Expand Down Expand Up @@ -54,17 +52,14 @@ export abstract class JellyfinApi {
// create the necessary headers for authentication
private static getSecurityHeaders(): { Authorization?: string } {
const parameters: Record<string, string> = {
Client: 'Chromecast'
Client: 'Chromecast',
Version: packageVersion
};

if (this.accessToken) {
parameters['Token'] = this.accessToken;
}

if (this.versionNumber) {
parameters['Version'] = this.versionNumber;
}

if (this.deviceId) {
parameters['DeviceId'] = this.deviceId;
}
Expand Down
1 change: 0 additions & 1 deletion src/types/global.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ interface SupportedCommands {
// /From commandHandler

declare global {
export const RECEIVERVERSION: string;
export interface Window {
mediaElement: HTMLElement | null;
playerManager: PlayerManager;
Expand Down
4 changes: 0 additions & 4 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable sort-keys */

import { defineConfig } from 'vite';
import { version } from './package.json';

export default defineConfig({
root: 'src',
Expand All @@ -14,8 +13,5 @@ export default defineConfig({
},
server: {
port: 9000
},
define: {
RECEIVERVERSION: JSON.stringify(version)
}
});

0 comments on commit 1e2f4f6

Please sign in to comment.