mirror of
https://github.com/chrisbenincasa/tunarr.git
synced 2026-04-18 09:03:35 -04:00
* Add new Plex server column for client identifier * Implement fixer to backfill plex server client identifiers * Fix build error
43 lines
966 B
TypeScript
43 lines
966 B
TypeScript
import { Entity, Property, Unique } from '@mikro-orm/core';
|
|
import { PlexServerSettings as PlexServerSettingsDTO } from '@tunarr/types';
|
|
import { BaseEntity } from './BaseEntity.js';
|
|
|
|
@Entity()
|
|
@Unique({ properties: ['name', 'uri'] })
|
|
export class PlexServerSettings extends BaseEntity {
|
|
@Property()
|
|
name!: string;
|
|
|
|
@Property()
|
|
uri!: string;
|
|
|
|
@Property()
|
|
accessToken!: string;
|
|
|
|
@Property({ default: true })
|
|
sendGuideUpdates!: boolean;
|
|
|
|
@Property({ default: true })
|
|
sendChannelUpdates!: boolean;
|
|
|
|
@Property()
|
|
index: number;
|
|
|
|
// Nullable for now!
|
|
@Property({ nullable: true })
|
|
clientIdentifier?: string;
|
|
|
|
toDTO(): PlexServerSettingsDTO {
|
|
return {
|
|
id: this.uuid,
|
|
name: this.name,
|
|
uri: this.uri,
|
|
accessToken: this.accessToken,
|
|
sendChannelUpdates: this.sendChannelUpdates,
|
|
sendGuideUpdates: this.sendGuideUpdates,
|
|
index: this.index,
|
|
clientIdentifier: this.clientIdentifier,
|
|
};
|
|
}
|
|
}
|