mirror of
https://github.com/lidarr/lidarr.git
synced 2025-07-13 00:23:59 -07:00
Add typings for Queue and Tracks
This commit is contained in:
parent
e7e6e8f908
commit
cbb1ed2b16
8 changed files with 127 additions and 0 deletions
|
@ -1,7 +1,10 @@
|
||||||
import AlbumAppState from './AlbumAppState';
|
import AlbumAppState from './AlbumAppState';
|
||||||
import ArtistAppState, { ArtistIndexAppState } from './ArtistAppState';
|
import ArtistAppState, { ArtistIndexAppState } from './ArtistAppState';
|
||||||
|
import QueueAppState from './QueueAppState';
|
||||||
import SettingsAppState from './SettingsAppState';
|
import SettingsAppState from './SettingsAppState';
|
||||||
import TagsAppState from './TagsAppState';
|
import TagsAppState from './TagsAppState';
|
||||||
|
import TrackFilesAppState from './TrackFilesAppState';
|
||||||
|
import TracksAppState from './TracksAppState';
|
||||||
|
|
||||||
interface FilterBuilderPropOption {
|
interface FilterBuilderPropOption {
|
||||||
id: string;
|
id: string;
|
||||||
|
@ -39,8 +42,11 @@ interface AppState {
|
||||||
albums: AlbumAppState;
|
albums: AlbumAppState;
|
||||||
artist: ArtistAppState;
|
artist: ArtistAppState;
|
||||||
artistIndex: ArtistIndexAppState;
|
artistIndex: ArtistIndexAppState;
|
||||||
|
queue: QueueAppState;
|
||||||
settings: SettingsAppState;
|
settings: SettingsAppState;
|
||||||
tags: TagsAppState;
|
tags: TagsAppState;
|
||||||
|
trackFiles: TrackFilesAppState;
|
||||||
|
tracksSelection: TracksAppState;
|
||||||
}
|
}
|
||||||
|
|
||||||
export default AppState;
|
export default AppState;
|
||||||
|
|
10
frontend/src/App/State/CustomFiltersAppState.ts
Normal file
10
frontend/src/App/State/CustomFiltersAppState.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import AppSectionState, {
|
||||||
|
AppSectionDeleteState,
|
||||||
|
} from 'App/State/AppSectionState';
|
||||||
|
import { CustomFilter } from './AppState';
|
||||||
|
|
||||||
|
interface CustomFiltersAppState
|
||||||
|
extends AppSectionState<CustomFilter>,
|
||||||
|
AppSectionDeleteState {}
|
||||||
|
|
||||||
|
export default CustomFiltersAppState;
|
49
frontend/src/App/State/QueueAppState.ts
Normal file
49
frontend/src/App/State/QueueAppState.ts
Normal file
|
@ -0,0 +1,49 @@
|
||||||
|
import ModelBase from 'App/ModelBase';
|
||||||
|
import { QualityModel } from 'Quality/Quality';
|
||||||
|
import CustomFormat from 'typings/CustomFormat';
|
||||||
|
import AppSectionState, { AppSectionItemState, Error } from './AppSectionState';
|
||||||
|
|
||||||
|
export interface StatusMessage {
|
||||||
|
title: string;
|
||||||
|
messages: string[];
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface Queue extends ModelBase {
|
||||||
|
quality: QualityModel;
|
||||||
|
customFormats: CustomFormat[];
|
||||||
|
size: number;
|
||||||
|
title: string;
|
||||||
|
sizeleft: number;
|
||||||
|
timeleft: string;
|
||||||
|
estimatedCompletionTime: string;
|
||||||
|
status: string;
|
||||||
|
trackedDownloadStatus: string;
|
||||||
|
trackedDownloadState: string;
|
||||||
|
statusMessages: StatusMessage[];
|
||||||
|
errorMessage: string;
|
||||||
|
downloadId: string;
|
||||||
|
protocol: string;
|
||||||
|
downloadClient: string;
|
||||||
|
outputPath: string;
|
||||||
|
artistId?: number;
|
||||||
|
albumId?: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface QueueDetailsAppState extends AppSectionState<Queue> {
|
||||||
|
params: unknown;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface QueuePagedAppState extends AppSectionState<Queue> {
|
||||||
|
isGrabbing: boolean;
|
||||||
|
grabError: Error;
|
||||||
|
isRemoving: boolean;
|
||||||
|
removeError: Error;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface QueueAppState {
|
||||||
|
status: AppSectionItemState<Queue>;
|
||||||
|
details: QueueDetailsAppState;
|
||||||
|
paged: QueuePagedAppState;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default QueueAppState;
|
10
frontend/src/App/State/TrackFilesAppState.ts
Normal file
10
frontend/src/App/State/TrackFilesAppState.ts
Normal file
|
@ -0,0 +1,10 @@
|
||||||
|
import AppSectionState, {
|
||||||
|
AppSectionDeleteState,
|
||||||
|
} from 'App/State/AppSectionState';
|
||||||
|
import { TrackFile } from 'TrackFile/TrackFile';
|
||||||
|
|
||||||
|
interface TrackFilesAppState
|
||||||
|
extends AppSectionState<TrackFile>,
|
||||||
|
AppSectionDeleteState {}
|
||||||
|
|
||||||
|
export default TrackFilesAppState;
|
6
frontend/src/App/State/TracksAppState.ts
Normal file
6
frontend/src/App/State/TracksAppState.ts
Normal file
|
@ -0,0 +1,6 @@
|
||||||
|
import AppSectionState from 'App/State/AppSectionState';
|
||||||
|
import Track from 'Track/Track';
|
||||||
|
|
||||||
|
type TracksAppState = AppSectionState<Track>;
|
||||||
|
|
||||||
|
export default TracksAppState;
|
19
frontend/src/Track/Track.ts
Normal file
19
frontend/src/Track/Track.ts
Normal file
|
@ -0,0 +1,19 @@
|
||||||
|
import ModelBase from 'App/ModelBase';
|
||||||
|
|
||||||
|
interface Track extends ModelBase {
|
||||||
|
artistId: number;
|
||||||
|
foreignTrackId: string;
|
||||||
|
foreignRecordingId: string;
|
||||||
|
trackFileId: number;
|
||||||
|
albumId: number;
|
||||||
|
explicit: boolean;
|
||||||
|
absoluteTrackNumber: number;
|
||||||
|
trackNumber: string;
|
||||||
|
title: string;
|
||||||
|
duration: number;
|
||||||
|
trackFile?: object;
|
||||||
|
mediumNumber: number;
|
||||||
|
hasFile: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default Track;
|
18
frontend/src/TrackFile/TrackFile.ts
Normal file
18
frontend/src/TrackFile/TrackFile.ts
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
import ModelBase from 'App/ModelBase';
|
||||||
|
import { QualityModel } from 'Quality/Quality';
|
||||||
|
import CustomFormat from 'typings/CustomFormat';
|
||||||
|
import MediaInfo from 'typings/MediaInfo';
|
||||||
|
|
||||||
|
export interface TrackFile extends ModelBase {
|
||||||
|
artistId: number;
|
||||||
|
albumId: number;
|
||||||
|
path: string;
|
||||||
|
size: number;
|
||||||
|
dateAdded: string;
|
||||||
|
sceneName: string;
|
||||||
|
releaseGroup: string;
|
||||||
|
quality: QualityModel;
|
||||||
|
customFormats: CustomFormat[];
|
||||||
|
mediaInfo: MediaInfo;
|
||||||
|
qualityCutoffNotMet: boolean;
|
||||||
|
}
|
9
frontend/src/typings/MediaInfo.ts
Normal file
9
frontend/src/typings/MediaInfo.ts
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
interface MediaInfo {
|
||||||
|
audioBitRate: string;
|
||||||
|
audioChannels: number;
|
||||||
|
audioCodec: string;
|
||||||
|
audioBits: string;
|
||||||
|
audioSampleRate: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export default MediaInfo;
|
Loading…
Add table
Add a link
Reference in a new issue