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
*/
AddToReadingProfile = 30,
SetReadingProfile = 30,
}
/**
@ -532,17 +532,7 @@ export class ActionFactoryService {
requiresAdmin: false,
requiredRoles: [],
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],
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,
title: 'delete',

View file

@ -31,9 +31,7 @@ import {ChapterService} from "./chapter.service";
import {VolumeService} from "./volume.service";
import {DefaultModalOptions} from "../_models/default-modal-options";
import {MatchSeriesModalComponent} from "../_single-module/match-series-modal/match-series-modal.component";
import {
BulkAddToReadingProfileComponent
} from "../cards/_modals/bulk-add-to-reading-profile/bulk-add-to-reading-profile.component";
import {BulkSetReadingProfileComponent} from "../cards/_modals/bulk-set-reading-profile/bulk-set-reading-profile.component";
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 callback
*/
addMultipleToReadingProfile(series: Array<Series>, callback?: BooleanActionCallback) {
SetReadingProfileForMultiple(series: Array<Series>, callback?: BooleanActionCallback) {
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.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">
<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";
@Component({
selector: 'app-bulk-add-to-reading-profile',
selector: 'app-bulk-set-reading-profile',
imports: [
ReactiveFormsModule,
FilterPipe,
TranslocoDirective
],
templateUrl: './bulk-add-to-reading-profile.component.html',
styleUrl: './bulk-add-to-reading-profile.component.scss'
templateUrl: './bulk-set-reading-profile.component.html',
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 readingProfileService = inject(ReadingProfileService);
private readonly toastr = inject(ToastrService);

View file

@ -144,7 +144,7 @@ export class BulkSelectionService {
*/
getActions(callback: (action: ActionItem<any>, data: any) => void) {
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) {
return this.applyFilterToList(this.actionFactory.getSeriesActions(callback), allowedActions);

View file

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

View file

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

View file

@ -1756,7 +1756,7 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
// menu only code
savePref() {
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);
break;
}
case Action.SetReadingProfile:
this.actionService.SetReadingProfileForMultiple([this.series]);
break;
default:
break;
}

View file

@ -1266,8 +1266,8 @@
"create": "{{common.create}}"
},
"bulk-add-to-reading-profile": {
"title": "Add to Reading profile",
"bulk-set-reading-profile": {
"title": "Set Reading profile",
"close": "{{common.close}}",
"filter-label": "{{common.filter}}",
"clear": "{{common.clear}}",
@ -1979,7 +1979,7 @@
"layout-mode-switched": "Layout mode switched to Single due to insufficient space to render double layout",
"no-next-chapter": "No Next 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}}",
"series-progress": "Series Progress: {{percentage}}"
},
@ -2714,7 +2714,7 @@
"remove-from-want-to-read-tooltip": "Remove series from Want to Read",
"remove-from-on-deck": "Remove 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",
"add-to-reading-list": "Add to Reading List",