1
0
Fork 0
mirror of https://github.com/lidarr/Lidarr synced 2024-12-22 07:42:28 +00:00

Add typings for Queue and Tracks

This commit is contained in:
Bogdan 2023-10-29 18:00:10 +02:00
parent e7e6e8f908
commit cbb1ed2b16
8 changed files with 127 additions and 0 deletions

View file

@ -1,7 +1,10 @@
import AlbumAppState from './AlbumAppState';
import ArtistAppState, { ArtistIndexAppState } from './ArtistAppState';
import QueueAppState from './QueueAppState';
import SettingsAppState from './SettingsAppState';
import TagsAppState from './TagsAppState';
import TrackFilesAppState from './TrackFilesAppState';
import TracksAppState from './TracksAppState';
interface FilterBuilderPropOption {
id: string;
@ -39,8 +42,11 @@ interface AppState {
albums: AlbumAppState;
artist: ArtistAppState;
artistIndex: ArtistIndexAppState;
queue: QueueAppState;
settings: SettingsAppState;
tags: TagsAppState;
trackFiles: TrackFilesAppState;
tracksSelection: TracksAppState;
}
export default AppState;

View 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;

View 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;

View 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;

View file

@ -0,0 +1,6 @@
import AppSectionState from 'App/State/AppSectionState';
import Track from 'Track/Track';
type TracksAppState = AppSectionState<Track>;
export default TracksAppState;

View 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;

View 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;
}

View file

@ -0,0 +1,9 @@
interface MediaInfo {
audioBitRate: string;
audioChannels: number;
audioCodec: string;
audioBits: string;
audioSampleRate: string;
}
export default MediaInfo;