Skip to content

Commit

Permalink
chore(api/client/web): rename AudioOptions to DownloadOptions
Browse files Browse the repository at this point in the history
Signed-off-by: Jordan Shatford <[email protected]>
  • Loading branch information
jordanshatford committed Sep 8, 2023
1 parent d8f15d4 commit 90a3c12
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 29 deletions.
4 changes: 2 additions & 2 deletions apps/api/app/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class DownloadQuality(str, enum.Enum):
WORST = 'worst'


class AudioOptions(BaseModel):
class DownloadOptions(BaseModel):
format: AudioFormat
quality: DownloadQuality

Expand All @@ -61,7 +61,7 @@ class Video(BaseModel):


class VideoWithOptions(Video):
options: AudioOptions
options: DownloadOptions


class VideoWithOptionsAndStatus(VideoWithOptions):
Expand Down
36 changes: 18 additions & 18 deletions apps/api/openapi.json
Original file line number Diff line number Diff line change
Expand Up @@ -420,22 +420,6 @@
],
"title": "AudioFormat"
},
"AudioOptions": {
"properties": {
"format": {
"$ref": "#/components/schemas/AudioFormat"
},
"quality": {
"$ref": "#/components/schemas/DownloadQuality"
}
},
"type": "object",
"required": [
"format",
"quality"
],
"title": "AudioOptions"
},
"Channel": {
"properties": {
"name": {
Expand Down Expand Up @@ -465,6 +449,22 @@
],
"title": "Channel"
},
"DownloadOptions": {
"properties": {
"format": {
"$ref": "#/components/schemas/AudioFormat"
},
"quality": {
"$ref": "#/components/schemas/DownloadQuality"
}
},
"type": "object",
"required": [
"format",
"quality"
],
"title": "DownloadOptions"
},
"DownloadQuality": {
"type": "string",
"enum": [
Expand Down Expand Up @@ -713,7 +713,7 @@
"$ref": "#/components/schemas/Channel"
},
"options": {
"$ref": "#/components/schemas/AudioOptions"
"$ref": "#/components/schemas/DownloadOptions"
}
},
"type": "object",
Expand Down Expand Up @@ -760,7 +760,7 @@
"$ref": "#/components/schemas/Channel"
},
"options": {
"$ref": "#/components/schemas/AudioOptions"
"$ref": "#/components/schemas/DownloadOptions"
},
"status": {
"$ref": "#/components/schemas/DownloadStatus"
Expand Down
6 changes: 3 additions & 3 deletions apps/web/src/lib/stores/settings.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { writable } from 'svelte/store';
import { AudioFormat, DownloadQuality, type AudioOptions } from '@yd/client';
import { AudioFormat, DownloadQuality, type DownloadOptions } from '@yd/client';
import { browser } from '$app/environment';

function createSettingsStore() {
const SETTINGS_KEY = 'settings';
const DEFAULT_SETTINGS: AudioOptions = {
const DEFAULT_SETTINGS: DownloadOptions = {
format: AudioFormat.MP3,
quality: DownloadQuality.BEST
};
Expand All @@ -15,7 +15,7 @@ function createSettingsStore() {
const data = localStorage?.getItem(SETTINGS_KEY);

if (data !== null) {
const parsedData = JSON.parse(data) as AudioOptions;
const parsedData = JSON.parse(data) as DownloadOptions;
// Make sure a value is set, if nothing is set use the default
if (!Object.values(AudioFormat).includes(parsedData.format)) {
parsedData.format = DEFAULT_SETTINGS.format;
Expand Down
2 changes: 1 addition & 1 deletion packages/client/src/generated/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export { OpenAPI } from './core/OpenAPI';
export type { OpenAPIConfig } from './core/OpenAPI';

export { AudioFormat } from './models/AudioFormat';
export type { AudioOptions } from './models/AudioOptions';
export type { Channel } from './models/Channel';
export type { DownloadOptions } from './models/DownloadOptions';
export { DownloadQuality } from './models/DownloadQuality';
export { DownloadState } from './models/DownloadState';
export type { DownloadStatus } from './models/DownloadStatus';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import type { AudioFormat } from './AudioFormat';
import type { DownloadQuality } from './DownloadQuality';

export type AudioOptions = {
export type DownloadOptions = {
format: AudioFormat;
quality: DownloadQuality;
};
Expand Down
4 changes: 2 additions & 2 deletions packages/client/src/generated/models/VideoWithOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/* tslint:disable */
/* eslint-disable */

import type { AudioOptions } from './AudioOptions';
import type { Channel } from './Channel';
import type { DownloadOptions } from './DownloadOptions';

export type VideoWithOptions = {
id: string;
Expand All @@ -13,6 +13,6 @@ export type VideoWithOptions = {
duration: string;
thumbnail: string;
channel: Channel;
options: AudioOptions;
options: DownloadOptions;
};

Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
/* tslint:disable */
/* eslint-disable */

import type { AudioOptions } from './AudioOptions';
import type { Channel } from './Channel';
import type { DownloadOptions } from './DownloadOptions';
import type { DownloadStatus } from './DownloadStatus';

export type VideoWithOptionsAndStatus = {
Expand All @@ -14,7 +14,7 @@ export type VideoWithOptionsAndStatus = {
duration: string;
thumbnail: string;
channel: Channel;
options: AudioOptions;
options: DownloadOptions;
status: DownloadStatus;
};

1 comment on commit 90a3c12

@vercel
Copy link

@vercel vercel bot commented on 90a3c12 Sep 8, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.