Compare commits

..

8 Commits

Author SHA1 Message Date
Isaac Abadi
7447ca038a Fixed issue where empty temp archive files would get generated 2023-05-18 21:22:20 -04:00
Glassed Silver
80b41af620 Merge pull request #910 from Tzahi12345/twitch-chat-fix
Twitch chat downloader fix for Docker
2023-05-12 07:01:12 +02:00
Tzahi12345
ab5d8dc5ca Merge pull request #911 from Tzahi12345/registration-fixes
Registration fixes
2023-05-12 00:03:05 -04:00
Tzahi12345
4b55c39f39 permissions code simplified 2023-05-11 23:14:40 -04:00
Tzahi12345
3ca296f195 Fixed compilation issue 2023-05-11 23:14:25 -04:00
Tzahi12345
d4fa640f0f Added tasks_manager to possible user/role permission in openapi 2023-05-11 02:47:06 -04:00
Tzahi12345
427eecf214 Fixed issue where after resetting the DB, admin would have to be registered twice 2023-05-11 02:44:05 -04:00
Tzahi12345
4f54e408a5 Removed erroneous error after registering admin 2023-05-11 02:43:37 -04:00
132 changed files with 155 additions and 156 deletions

View File

@@ -2742,7 +2742,7 @@ components:
error:
type: string
schedule:
type: object
$ref: '#/components/schemas/Schedule'
options:
type: object
Schedule:
@@ -2877,6 +2877,7 @@ components:
- sharing
- advanced_download
- downloads_manager
- tasks_manager
YesNo:
type: string
enum:

View File

@@ -68,15 +68,7 @@ exports.initialize = function () {
const setupRoles = async () => {
const required_roles = {
admin: {
permissions: [
'filemanager',
'settings',
'subscriptions',
'sharing',
'advanced_download',
'downloads_manager',
'tasks_manager'
]
permissions: consts.AVAILABLE_PERMISSIONS
},
user: {
permissions: [

View File

@@ -371,10 +371,13 @@ async function generateArgsForSubscription(sub, user_uid, redownload = false, de
// skip videos that are in the archive. otherwise sub download can be permanently slow (vs. just the first time)
const archive_text = await archive_api.generateArchive(sub.type, sub.user_uid, sub.id);
logger.verbose(`Generating temporary archive file for subscription ${sub.name} with ${archive_text.split('\n').length - 1} entries.`)
const archive_path = path.join(appendedBasePath, 'archive.txt');
await fs.writeFile(archive_path, archive_text);
downloadConfig.push('--download-archive', archive_path);
const archive_count = archive_text.split('\n').length - 1;
if (archive_count > 0) {
logger.verbose(`Generating temporary archive file for subscription ${sub.name} with ${archive_count} entries.`)
const archive_path = path.join(appendedBasePath, 'archive.txt');
await fs.writeFile(archive_path, archive_text);
downloadConfig.push('--download-archive', archive_path);
}
if (sub.custom_args) {
const customArgsArray = sub.custom_args.split(',,');

View File

@@ -3,5 +3,5 @@
/* eslint-disable */
export type Config = {
YoutubeDLMaterial: any;
YoutubeDLMaterial: Record<string, any>;
};

View File

@@ -26,5 +26,5 @@ export type Download = {
user_uid?: string;
sub_id?: string;
sub_name?: string;
prefetched_info?: any;
prefetched_info?: Record<string, any>;
};

View File

@@ -5,6 +5,6 @@
export type GetFileFormatsResponse = {
success: boolean;
result: {
formats?: Array<any>;
formats?: Array<Record<string, any>>;
};
};

View File

@@ -6,5 +6,5 @@ import type { Subscription } from './Subscription';
export type GetSubscriptionResponse = {
subscription: Subscription;
files: Array<any>;
files: Array<Record<string, any>>;
};

View File

@@ -11,6 +11,6 @@ export type Notification = {
user_uid?: string;
action?: Array<NotificationAction>;
read: boolean;
data?: any;
data?: Record<string, any>;
timestamp: number;
};

View File

@@ -15,5 +15,5 @@ export type Subscription = {
timerange?: string;
custom_args?: string;
custom_output?: string;
videos: Array<any>;
videos: Array<Record<string, any>>;
};

View File

@@ -2,6 +2,8 @@
/* tslint:disable */
/* eslint-disable */
import type { Schedule } from './Schedule';
export type Task = {
key: string;
title?: string;
@@ -9,8 +11,8 @@ export type Task = {
last_confirmed: number;
running: boolean;
confirming: boolean;
data: any;
data: Record<string, any>;
error: string;
schedule: any;
options?: any;
schedule: Schedule;
options?: Record<string, any>;
};

View File

@@ -10,5 +10,5 @@ export type UpdateFileRequest = {
/**
* Object with fields to update as keys and their new values
*/
change_obj: any;
change_obj: Record<string, any>;
};

View File

@@ -4,5 +4,5 @@
export type UpdateTaskDataRequest = {
task_key: string;
new_data: any;
new_data: Record<string, any>;
};

View File

@@ -4,5 +4,5 @@
export type UpdateTaskOptionsRequest = {
task_key: string;
new_options: any;
new_options: Record<string, any>;
};

View File

@@ -9,4 +9,5 @@ export enum UserPermission {
SHARING = 'sharing',
ADVANCED_DOWNLOAD = 'advanced_download',
DOWNLOADS_MANAGER = 'downloads_manager',
TASKS_MANAGER = 'tasks_manager',
}

View File

@@ -84,8 +84,8 @@ export class AppComponent implements OnInit, AfterViewInit {
this.postsService.open_create_default_admin_dialog.subscribe(open => {
if (open) {
const dialogRef = this.dialog.open(SetDefaultAdminDialogComponent);
dialogRef.afterClosed().subscribe(success => {
if (success) {
dialogRef.afterClosed().subscribe(res => {
if (!res || !res['user']) {
if (this.router.url !== '/login') { this.router.navigate(['/login']); }
} else {
console.error('Failed to create default admin account. See logs for details.');

View File

@@ -734,7 +734,7 @@ export class PostsService implements CanActivate {
this.afterLogin(res['user'], res['token'], res['permissions'], res['available_permissions']);
}
}, err => {
if (err.status === 401) {
if (err === 'Unauthorized') {
this.sendToLogin();
this.token = null;
this.resetHttpParams();