diff --git a/Public API v1.yaml b/Public API v1.yaml index 951c27d..735cfe7 100644 --- a/Public API v1.yaml +++ b/Public API v1.yaml @@ -2109,8 +2109,6 @@ components: tag: type: string DBInfoResponse: - required: - - db_info type: object properties: using_local_db: @@ -2132,6 +2130,8 @@ components: $ref: '#/components/schemas/TableInfo' download_queue: $ref: '#/components/schemas/TableInfo' + archives: + $ref: '#/components/schemas/TableInfo' TransferDBResponse: required: - success diff --git a/angular.json b/angular.json index 454c39b..8f50ad6 100644 --- a/angular.json +++ b/angular.json @@ -190,5 +190,8 @@ "@schematics/angular:directive": { "prefix": "app" } + }, + "cli": { + "analytics": false } } \ No newline at end of file diff --git a/backend/app.js b/backend/app.js index 3c8e022..2f7ef49 100644 --- a/backend/app.js +++ b/backend/app.js @@ -782,7 +782,7 @@ app.post('/api/restartServer', optionalJwt, (req, res) => { app.get('/api/getDBInfo', optionalJwt, async (req, res) => { const db_info = await db_api.getDBStats(); - res.send({db_info: db_info}); + res.send(db_info); }); app.post('/api/transferDB', optionalJwt, async (req, res) => { @@ -1084,9 +1084,6 @@ app.post('/api/disableSharing', optionalJwt, async function(req, res) { await db_api.updateRecord('files', {uid: uid}, {sharingEnabled: false}) } else if (is_playlist) { await db_api.updateRecord(`playlists`, {id: uid}, {sharingEnabled: false}); - } else if (type === 'subscription') { - // TODO: Implement. Main blocker right now is subscription videos are not stored in the DB, they are searched for every - // time they are requested from the subscription directory. } else { // error success = false; diff --git a/src/app/components/manage-role/manage-role.component.html b/src/app/components/manage-role/manage-role.component.html index 3ace5a5..2e45c17 100644 --- a/src/app/components/manage-role/manage-role.component.html +++ b/src/app/components/manage-role/manage-role.component.html @@ -4,7 +4,7 @@
{{permissionToLabel[permission] ? permissionToLabel[permission] : permission}}
- + Yes No diff --git a/src/app/components/modify-users/modify-users.component.html b/src/app/components/modify-users/modify-users.component.html index 954aee9..c651971 100644 --- a/src/app/components/modify-users/modify-users.component.html +++ b/src/app/components/modify-users/modify-users.component.html @@ -5,7 +5,7 @@
Search - +
diff --git a/src/app/components/modify-users/modify-users.component.ts b/src/app/components/modify-users/modify-users.component.ts index 5aec419..a290a7e 100644 --- a/src/app/components/modify-users/modify-users.component.ts +++ b/src/app/components/modify-users/modify-users.component.ts @@ -63,7 +63,8 @@ export class ModifyUsersComponent implements OnInit, AfterViewInit { this.pageSizeOptions = setPageSizeOptionsInput.split(',').map(str => +str); } - applyFilter(filterValue: string) { + applyFilter(event: KeyboardEvent) { + let filterValue = (event.target as HTMLInputElement).value; // "as HTMLInputElement" is required: https://angular.io/guide/user-input#type-the-event filterValue = filterValue.trim(); // Remove whitespace filterValue = filterValue.toLowerCase(); // Datasource defaults to lowercase matches this.dataSource.filter = filterValue; diff --git a/src/app/components/recent-videos/recent-videos.component.html b/src/app/components/recent-videos/recent-videos.component.html index 6acabc4..3edcb96 100644 --- a/src/app/components/recent-videos/recent-videos.component.html +++ b/src/app/components/recent-videos/recent-videos.component.html @@ -75,7 +75,7 @@
- {{(file.type === 'audio' || file.isAudio) ? 'audiotrack' : 'movie'}} + {{file.isAudio ? 'audiotrack' : 'movie'}} {{file.title}}
{{file.registered | date:'shortDate'}}
@@ -88,7 +88,7 @@ - + diff --git a/src/app/components/recent-videos/recent-videos.component.ts b/src/app/components/recent-videos/recent-videos.component.ts index 0d463d8..1231eb8 100644 --- a/src/app/components/recent-videos/recent-videos.component.ts +++ b/src/app/components/recent-videos/recent-videos.component.ts @@ -7,6 +7,7 @@ import { Subject } from 'rxjs'; import { distinctUntilChanged } from 'rxjs/operators'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; import { MatChipListboxChange } from '@angular/material/chips'; +import { MatSelectionListChange } from '@angular/material/list'; @Component({ selector: 'app-recent-videos', @@ -376,8 +377,9 @@ export class RecentVideosComponent implements OnInit { this.getAllFiles(); } - fileSelectionChanged(event: { option: { _selected: boolean; value: DatabaseFile; } }): void { - const adding = event.option._selected; + fileSelectionChanged(event: MatSelectionListChange): void { + // TODO: make sure below line is possible (_selected is private) + const adding = event.option['_selected']; const value = event.option.value; if (adding) { this.selected_data.push(value.uid); diff --git a/src/app/components/sort-property/sort-property.component.ts b/src/app/components/sort-property/sort-property.component.ts index f86fd92..3d104b6 100644 --- a/src/app/components/sort-property/sort-property.component.ts +++ b/src/app/components/sort-property/sort-property.component.ts @@ -33,8 +33,8 @@ export class SortPropertyComponent { @Input() sortProperty = 'registered'; @Input() descendingMode = true; - @Output() sortPropertyChange = new EventEmitter(); - @Output() descendingModeChange = new EventEmitter(); + @Output() sortPropertyChange = new EventEmitter(); + @Output() descendingModeChange = new EventEmitter(); @Output() sortOptionChanged = new EventEmitter(); toggleModeChange(): void { diff --git a/src/app/components/twitch-chat/twitch-chat.component.ts b/src/app/components/twitch-chat/twitch-chat.component.ts index 8db7e64..88ccdf5 100644 --- a/src/app/components/twitch-chat/twitch-chat.component.ts +++ b/src/app/components/twitch-chat/twitch-chat.component.ts @@ -45,7 +45,7 @@ export class TwitchChatComponent implements OnInit, OnDestroy { return position > height - threshold; } - scrollToBottom = (force_scroll) => { + scrollToBottom = (force_scroll = false) => { if (force_scroll || this.isUserNearBottom()) { this.scrollContainer.scrollTop = this.scrollContainer.scrollHeight; } diff --git a/src/app/components/unified-file-card/unified-file-card.component.html b/src/app/components/unified-file-card/unified-file-card.component.html index d8f43c3..55a4cb5 100644 --- a/src/app/components/unified-file-card/unified-file-card.component.html +++ b/src/app/components/unified-file-card/unified-file-card.component.html @@ -5,7 +5,7 @@ Auto-generated {{file_obj.registered | date:'shortDate' : undefined : locale.ngID}}
-
+
- +
{{card_size === 'large' && file_obj.uploader ? file_obj.uploader + ' - ' : ''}}{{!is_playlist ? file_obj.title : file_obj.name}} - +
diff --git a/src/app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component.html b/src/app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component.html index 13a2c2c..5dbe899 100644 --- a/src/app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component.html +++ b/src/app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component.html @@ -10,7 +10,7 @@ - + {{arg}} cancel diff --git a/src/app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component.ts b/src/app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component.ts index 3fddfc2..1902a33 100644 --- a/src/app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component.ts +++ b/src/app/dialogs/arg-modifier-dialog/arg-modifier-dialog.component.ts @@ -3,7 +3,7 @@ import { COMMA, ENTER } from '@angular/cdk/keycodes'; import { MAT_DIALOG_DATA, MatDialogRef, MatDialog } from '@angular/material/dialog'; import { CdkDragDrop, moveItemInArray } from '@angular/cdk/drag-drop'; import { UntypedFormControl } from '@angular/forms'; -import { args, args_info } from './youtubedl_args'; +import { args, ArgsByCategory, args_info } from './youtubedl_args'; import { Observable } from 'rxjs'; import { map } from 'rxjs/operators/map'; import { startWith } from 'rxjs/operators/startWith'; @@ -38,7 +38,7 @@ export class ArgModifierDialogComponent implements OnInit, AfterViewInit { stateCtrl = new UntypedFormControl(); chipCtrl = new UntypedFormControl(); availableArgs = null; - argsByCategory = null; + argsByCategory: ArgsByCategory = null; argsByKey = null; argsInfo = null; filteredOptions: Observable; diff --git a/src/app/dialogs/arg-modifier-dialog/youtubedl_args.ts b/src/app/dialogs/arg-modifier-dialog/youtubedl_args.ts index dab6731..9a2bdf4 100644 --- a/src/app/dialogs/arg-modifier-dialog/youtubedl_args.ts +++ b/src/app/dialogs/arg-modifier-dialog/youtubedl_args.ts @@ -72,7 +72,7 @@ const download = [ {'key': '--hls-prefer-ffmpeg', 'description': 'Use ffmpeg instead of the native HLS downloader'}, {'key': '--hls-use-mpegts', 'description': 'Use the mpegts container for HLS videos, allowing to play the video while downloading (some players may not be able to play it)'}, {'key': '--external-downloader', 'description': 'Use the specified external downloader. Currently supports aria2c,avconv,axel,curl,ffmpeg,httpie,wget'}, - {'key': '--external-downloader-args'} + {'key': '--external-downloader-args', 'description': 'Give these arguments to the external downloader'} ]; const filesystem = [ @@ -195,7 +195,7 @@ const post_processing = [ {'key': '--convert-subs', 'description': 'Convert the subtitles to other format (currently supported: srt|ass|vtt|lrc)'} ]; -export const args_info = { +export const args_info: ArgsInfo = { 'uncategorized' : {'label': 'Main'}, 'network' : {'label': 'Network'}, 'geo_restriction': {'label': 'Geo Restriction'}, @@ -212,7 +212,7 @@ export const args_info = { 'post_processing': {'label': 'Post Processing'}, }; -export const args = { +export const args: ArgsByCategory = { 'uncategorized' : uncategorized, 'network' : network, 'geo_restriction': geo_restriction, @@ -228,3 +228,8 @@ export const args = { 'adobe_pass' : adobe_pass, 'post_processing': post_processing } + +export type ArgInfo = {label: string} +export type ArgsInfo = {[key: string]: ArgInfo} +export type Arg = {key: string, description: string}; +export type ArgsByCategory = {[key: string]: Arg[]}; diff --git a/src/app/dialogs/video-info-dialog/video-info-dialog.component.html b/src/app/dialogs/video-info-dialog/video-info-dialog.component.html index 609bc42..a0b84d4 100644 --- a/src/app/dialogs/video-info-dialog/video-info-dialog.component.html +++ b/src/app/dialogs/video-info-dialog/video-info-dialog.component.html @@ -42,7 +42,7 @@ N/A - {{available_category.value.name}} + {{available_category.value['name']}} diff --git a/src/app/main/main.component.html b/src/app/main/main.component.html index 9ff65f2..7ac84ee 100644 --- a/src/app/main/main.component.html +++ b/src/app/main/main.component.html @@ -19,7 +19,7 @@ Quality - + Best @@ -67,7 +67,7 @@

- + Only Audio @@ -112,13 +112,13 @@
- + Use custom args - + Replace args @@ -134,7 +134,7 @@
- + Use custom output @@ -149,7 +149,7 @@
- + Use authentication @@ -166,7 +166,7 @@
- + Crop file diff --git a/src/app/player/player.component.html b/src/app/player/player.component.html index 21bdaef..4d0769f 100644 --- a/src/app/player/player.component.html +++ b/src/app/player/player.component.html @@ -4,9 +4,9 @@
-
@@ -34,7 +34,7 @@ - + @@ -44,7 +44,7 @@
- + {{playlist_item.label}}
diff --git a/src/app/posts.services.ts b/src/app/posts.services.ts index 4cda439..eb392b4 100644 --- a/src/app/posts.services.ts +++ b/src/app/posts.services.ts @@ -110,6 +110,7 @@ import { } from '../api-types'; import { isoLangs } from './settings/locales_list'; import { Title } from '@angular/platform-browser'; +import { MatDrawerMode } from '@angular/material/sidenav'; @Injectable() export class PostsService implements CanActivate { @@ -119,7 +120,7 @@ export class PostsService implements CanActivate { THEMES_CONFIG = THEMES_CONFIG; theme; card_size = 'medium'; - sidepanel_mode = 'over'; + sidepanel_mode: MatDrawerMode = 'over'; // auth auth_token = '4241b401-7236-493e-92b5-b72696b9d853'; @@ -215,8 +216,8 @@ export class PostsService implements CanActivate { if (yes_reload) { this.reloadConfig(); } }); - if (localStorage.getItem('sidepanel_mode')) { - this.sidepanel_mode = localStorage.getItem('sidepanel_mode'); + if (localStorage.getItem('sidepanel_mode') as MatDrawerMode) { + this.sidepanel_mode = localStorage.getItem('sidepanel_mode') as MatDrawerMode; } if (localStorage.getItem('card_size')) { diff --git a/src/app/settings/settings.component.html b/src/app/settings/settings.component.html index 8e088ce..c4ca1c2 100644 --- a/src/app/settings/settings.component.html +++ b/src/app/settings/settings.component.html @@ -521,7 +521,7 @@
- Auth method + Auth method Internal @@ -534,31 +534,31 @@
- LDAP URL + LDAP URL
- Bind DN + Bind DN
- Bind Credentials + Bind Credentials
- Search Base + Search Base
- Search Filter + Search Filter
diff --git a/src/app/settings/settings.component.ts b/src/app/settings/settings.component.ts index 7577fb2..f4ccb51 100644 --- a/src/app/settings/settings.component.ts +++ b/src/app/settings/settings.component.ts @@ -13,7 +13,7 @@ import { moveItemInArray, CdkDragDrop } from '@angular/cdk/drag-drop'; import { InputDialogComponent } from 'app/input-dialog/input-dialog.component'; import { EditCategoryDialogComponent } from 'app/dialogs/edit-category-dialog/edit-category-dialog.component'; import { ActivatedRoute, Router } from '@angular/router'; -import { Category } from 'api-types'; +import { Category, DBInfoResponse } from 'api-types'; import { GenerateRssUrlComponent } from 'app/dialogs/generate-rss-url/generate-rss-url.component'; @Component({ @@ -32,7 +32,7 @@ export class SettingsComponent implements OnInit { generated_bookmarklet_code = null; bookmarkletAudioOnly = false; - db_info = null; + db_info: DBInfoResponse = null; db_transferring = false; testing_connection_string = false; @@ -315,7 +315,7 @@ export class SettingsComponent implements OnInit { getDBInfo(): void { this.postsService.getDBInfo().subscribe(res => { - this.db_info = res['db_info']; + this.db_info = res; }); } diff --git a/tsconfig.json b/tsconfig.json index 5012d09..5fc3700 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -26,4 +26,7 @@ "exclude": [ "assets/default.json" ], + "angularCompilerOptions": { + "strictTemplates": true, + } } \ No newline at end of file