Some renaming

BUGS
- WebToon on Firefox MacOS ????
- Series profile isn't removed when reading profile is ???
This commit is contained in:
Amelia 2025-05-29 23:09:48 +02:00
parent d83bb7ac3e
commit cfc65d14a0
No known key found for this signature in database
GPG key ID: D6D0ECE365407EAA
11 changed files with 34 additions and 33 deletions

View file

@ -125,7 +125,7 @@ export enum Action {
/** /**
* Add to a reading profile * Add to a reading profile
*/ */
AddToReadingProfile = 30, SetReadingProfile = 30,
} }
/** /**
@ -532,17 +532,7 @@ export class ActionFactoryService {
requiresAdmin: false, requiresAdmin: false,
requiredRoles: [], requiredRoles: [],
children: [], children: [],
}, }
{
action: Action.AddToReadingProfile,
title: 'add-to-reading-profile',
description: 'add-to-reading-profile-tooltip',
callback: this.dummyCallback,
shouldRender: this.dummyShouldRender,
requiresAdmin: false,
requiredRoles: [],
children: [],
},
], ],
}, },
{ {
@ -608,6 +598,16 @@ export class ActionFactoryService {
requiredRoles: [Role.Admin], requiredRoles: [Role.Admin],
children: [], children: [],
}, },
{
action: Action.SetReadingProfile,
title: 'set-reading-profile',
description: 'set-reading-profile-tooltip',
callback: this.dummyCallback,
shouldRender: this.dummyShouldRender,
requiresAdmin: false,
requiredRoles: [],
children: [],
},
{ {
action: Action.Delete, action: Action.Delete,
title: 'delete', title: 'delete',

View file

@ -31,9 +31,7 @@ import {ChapterService} from "./chapter.service";
import {VolumeService} from "./volume.service"; import {VolumeService} from "./volume.service";
import {DefaultModalOptions} from "../_models/default-modal-options"; import {DefaultModalOptions} from "../_models/default-modal-options";
import {MatchSeriesModalComponent} from "../_single-module/match-series-modal/match-series-modal.component"; import {MatchSeriesModalComponent} from "../_single-module/match-series-modal/match-series-modal.component";
import { import {BulkSetReadingProfileComponent} from "../cards/_modals/bulk-set-reading-profile/bulk-set-reading-profile.component";
BulkAddToReadingProfileComponent
} from "../cards/_modals/bulk-add-to-reading-profile/bulk-add-to-reading-profile.component";
export type LibraryActionCallback = (library: Partial<Library>) => void; export type LibraryActionCallback = (library: Partial<Library>) => void;
@ -817,14 +815,14 @@ export class ActionService {
} }
/** /**
* Adds series to a reading list * Sets the reading profile for multiple series
* @param series * @param series
* @param callback * @param callback
*/ */
addMultipleToReadingProfile(series: Array<Series>, callback?: BooleanActionCallback) { SetReadingProfileForMultiple(series: Array<Series>, callback?: BooleanActionCallback) {
if (this.readingListModalRef != null) { return; } if (this.readingListModalRef != null) { return; }
this.readingListModalRef = this.modalService.open(BulkAddToReadingProfileComponent, { scrollable: true, size: 'md', fullscreen: 'md' }); this.readingListModalRef = this.modalService.open(BulkSetReadingProfileComponent, { scrollable: true, size: 'md', fullscreen: 'md' });
this.readingListModalRef.componentInstance.seriesIds = series.map(s => s.id) this.readingListModalRef.componentInstance.seriesIds = series.map(s => s.id)
this.readingListModalRef.componentInstance.title = "hi" this.readingListModalRef.componentInstance.title = "hi"

View file

@ -1,4 +1,4 @@
<ng-container *transloco="let t; prefix: 'bulk-add-to-reading-profile'"> <ng-container *transloco="let t; prefix: 'bulk-set-reading-profile'">
<div class="modal-header"> <div class="modal-header">
<h4 class="modal-title" id="modal-basic-title">{{t('title')}}</h4> <h4 class="modal-title" id="modal-basic-title">{{t('title')}}</h4>

View file

@ -9,16 +9,16 @@ import {ReadingProfile} from "../../../_models/preferences/reading-profiles";
import {FilterPipe} from "../../../_pipes/filter.pipe"; import {FilterPipe} from "../../../_pipes/filter.pipe";
@Component({ @Component({
selector: 'app-bulk-add-to-reading-profile', selector: 'app-bulk-set-reading-profile',
imports: [ imports: [
ReactiveFormsModule, ReactiveFormsModule,
FilterPipe, FilterPipe,
TranslocoDirective TranslocoDirective
], ],
templateUrl: './bulk-add-to-reading-profile.component.html', templateUrl: './bulk-set-reading-profile.component.html',
styleUrl: './bulk-add-to-reading-profile.component.scss' styleUrl: './bulk-set-reading-profile.component.scss'
}) })
export class BulkAddToReadingProfileComponent implements OnInit, AfterViewInit { export class BulkSetReadingProfileComponent implements OnInit, AfterViewInit {
private readonly modal = inject(NgbActiveModal); private readonly modal = inject(NgbActiveModal);
private readonly readingProfileService = inject(ReadingProfileService); private readonly readingProfileService = inject(ReadingProfileService);
private readonly toastr = inject(ToastrService); private readonly toastr = inject(ToastrService);

View file

@ -144,7 +144,7 @@ export class BulkSelectionService {
*/ */
getActions(callback: (action: ActionItem<any>, data: any) => void) { getActions(callback: (action: ActionItem<any>, data: any) => void) {
const allowedActions = [Action.AddToReadingList, Action.MarkAsRead, Action.MarkAsUnread, Action.AddToCollection, const allowedActions = [Action.AddToReadingList, Action.MarkAsRead, Action.MarkAsUnread, Action.AddToCollection,
Action.Delete, Action.AddToWantToReadList, Action.RemoveFromWantToReadList, Action.AddToReadingProfile]; Action.Delete, Action.AddToWantToReadList, Action.RemoveFromWantToReadList, Action.SetReadingProfile];
if (Object.keys(this.selectedCards).filter(item => item === 'series').length > 0) { if (Object.keys(this.selectedCards).filter(item => item === 'series').length > 0) {
return this.applyFilterToList(this.actionFactory.getSeriesActions(callback), allowedActions); return this.applyFilterToList(this.actionFactory.getSeriesActions(callback), allowedActions);

View file

@ -276,8 +276,8 @@ export class SeriesCardComponent implements OnInit, OnChanges {
case Action.Download: case Action.Download:
this.downloadService.download('series', this.series); this.downloadService.download('series', this.series);
break; break;
case Action.AddToReadingProfile: case Action.SetReadingProfile:
this.actionService.addMultipleToReadingProfile([this.series]); this.actionService.SetReadingProfileForMultiple([this.series]);
break; break;
default: default:
break; break;

View file

@ -149,8 +149,8 @@ export class LibraryDetailComponent implements OnInit {
this.loadPage(); this.loadPage();
}); });
break; break;
case Action.AddToReadingProfile: case Action.SetReadingProfile:
this.actionService.addMultipleToReadingProfile(selectedSeries, (success) => { this.actionService.SetReadingProfileForMultiple(selectedSeries, (success) => {
this.bulkLoader = false; this.bulkLoader = false;
this.cdRef.markForCheck(); this.cdRef.markForCheck();
if (!success) return; if (!success) return;

View file

@ -1756,7 +1756,7 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
// menu only code // menu only code
savePref() { savePref() {
this.readingProfileService.updateProfile(this.packReadingProfile()).subscribe(_ => { this.readingProfileService.updateProfile(this.packReadingProfile()).subscribe(_ => {
this.toastr.success(translate('manga-reader.user-preferences-updated')); this.toastr.success(translate('manga-reader.reading-profile-updated'));
}) })
} }

View file

@ -609,6 +609,9 @@ export class SeriesDetailComponent implements OnInit, AfterContentChecked {
this.actionService.sendToDevice(chapterIds, device); this.actionService.sendToDevice(chapterIds, device);
break; break;
} }
case Action.SetReadingProfile:
this.actionService.SetReadingProfileForMultiple([this.series]);
break;
default: default:
break; break;
} }

View file

@ -1266,8 +1266,8 @@
"create": "{{common.create}}" "create": "{{common.create}}"
}, },
"bulk-add-to-reading-profile": { "bulk-set-reading-profile": {
"title": "Add to Reading profile", "title": "Set Reading profile",
"close": "{{common.close}}", "close": "{{common.close}}",
"filter-label": "{{common.filter}}", "filter-label": "{{common.filter}}",
"clear": "{{common.clear}}", "clear": "{{common.clear}}",
@ -1979,7 +1979,7 @@
"layout-mode-switched": "Layout mode switched to Single due to insufficient space to render double layout", "layout-mode-switched": "Layout mode switched to Single due to insufficient space to render double layout",
"no-next-chapter": "No Next Chapter", "no-next-chapter": "No Next Chapter",
"no-prev-chapter": "No Previous Chapter", "no-prev-chapter": "No Previous Chapter",
"user-preferences-updated": "User preferences updated", "reading-profile-updated": "Reading profile updated",
"emulate-comic-book-label": "{{manage-reading-profiles.emulate-comic-book-label}}", "emulate-comic-book-label": "{{manage-reading-profiles.emulate-comic-book-label}}",
"series-progress": "Series Progress: {{percentage}}" "series-progress": "Series Progress: {{percentage}}"
}, },
@ -2714,7 +2714,7 @@
"remove-from-want-to-read-tooltip": "Remove series from Want to Read", "remove-from-want-to-read-tooltip": "Remove series from Want to Read",
"remove-from-on-deck": "Remove From On Deck", "remove-from-on-deck": "Remove From On Deck",
"remove-from-on-deck-tooltip": "Remove series from showing from On Deck", "remove-from-on-deck-tooltip": "Remove series from showing from On Deck",
"add-to-reading-profile": "Add to Reading Profile", "set-reading-profile": "Set Reading Profile",
"others": "Others", "others": "Others",
"add-to-reading-list": "Add to Reading List", "add-to-reading-list": "Add to Reading List",