mirror of
https://github.com/Kareadita/Kavita.git
synced 2025-07-09 03:04:19 -04:00
Logging Cleanup (#668)
* Do not allow non-admins to change their passwords when authentication is disabled * Clean up the login page so that input field text is black * cleanup some resizing when typing a password and having a lot of users * Changed the LastActive for a user to not just be login, but also when they open an already authenticated session. * Removed some verbose debugging statements and moved some debug to information to be more prevelant to logs for default installs. * In Progress now sends progress information on the Series * Add ability to add cards to recently added when new series are added in backend * Implemented the ability to click the glasses icon to turn off incognito mode from within the reader so you can start tracking progress * Don't warn the user about authentication when they don't touch that control
This commit is contained in:
parent
5e3b799747
commit
355f50fd5d
@ -212,6 +212,8 @@ namespace API.Controllers
|
|||||||
.Take(userParams.PageSize).ToList();
|
.Take(userParams.PageSize).ToList();
|
||||||
var pagedList = new PagedList<SeriesDto>(listResults, listResults.Count, userParams.PageNumber, userParams.PageSize);
|
var pagedList = new PagedList<SeriesDto>(listResults, listResults.Count, userParams.PageNumber, userParams.PageSize);
|
||||||
|
|
||||||
|
await _unitOfWork.SeriesRepository.AddSeriesModifiers(userId, pagedList);
|
||||||
|
|
||||||
Response.AddPaginationHeader(pagedList.CurrentPage, pagedList.PageSize, pagedList.TotalCount, pagedList.TotalPages);
|
Response.AddPaginationHeader(pagedList.CurrentPage, pagedList.PageSize, pagedList.TotalCount, pagedList.TotalPages);
|
||||||
|
|
||||||
return Ok(pagedList);
|
return Ok(pagedList);
|
||||||
|
@ -216,14 +216,14 @@ namespace API.Services
|
|||||||
var chunkInfo = await _unitOfWork.SeriesRepository.GetChunkInfo(library.Id);
|
var chunkInfo = await _unitOfWork.SeriesRepository.GetChunkInfo(library.Id);
|
||||||
var stopwatch = Stopwatch.StartNew();
|
var stopwatch = Stopwatch.StartNew();
|
||||||
var totalTime = 0L;
|
var totalTime = 0L;
|
||||||
_logger.LogDebug($"[MetadataService] Refreshing Library {library.Name}. Total Items: {chunkInfo.TotalSize}. Total Chunks: {chunkInfo.TotalChunks} with {chunkInfo.ChunkSize} size.");
|
_logger.LogInformation("[MetadataService] Refreshing Library {LibraryName}. Total Items: {TotalSize}. Total Chunks: {TotalChunks} with {ChunkSize} size", library.Name, chunkInfo.TotalSize, chunkInfo.TotalChunks, chunkInfo.ChunkSize);
|
||||||
|
|
||||||
// This technically does
|
// This technically does
|
||||||
for (var chunk = 1; chunk <= chunkInfo.TotalChunks; chunk++)
|
for (var chunk = 1; chunk <= chunkInfo.TotalChunks; chunk++)
|
||||||
{
|
{
|
||||||
totalTime += stopwatch.ElapsedMilliseconds;
|
totalTime += stopwatch.ElapsedMilliseconds;
|
||||||
stopwatch.Restart();
|
stopwatch.Restart();
|
||||||
_logger.LogDebug($"[MetadataService] Processing chunk {chunk} / {chunkInfo.TotalChunks} with size {chunkInfo.ChunkSize} Series ({chunk * chunkInfo.ChunkSize} - {(chunk + 1) * chunkInfo.ChunkSize}");
|
_logger.LogInformation("[MetadataService] Processing chunk {ChunkNumber} / {TotalChunks} with size {ChunkSize}. Series ({SeriesStart} - {SeriesEnd}",
|
||||||
|
chunk, chunkInfo.TotalChunks, chunkInfo.ChunkSize, chunk * chunkInfo.ChunkSize, (chunk + 1) * chunkInfo.ChunkSize);
|
||||||
var nonLibrarySeries = await _unitOfWork.SeriesRepository.GetFullSeriesForLibraryIdAsync(library.Id,
|
var nonLibrarySeries = await _unitOfWork.SeriesRepository.GetFullSeriesForLibraryIdAsync(library.Id,
|
||||||
new UserParams()
|
new UserParams()
|
||||||
{
|
{
|
||||||
|
@ -133,13 +133,11 @@ namespace API.Services.Tasks.Scanner
|
|||||||
public string MergeName(ParserInfo info)
|
public string MergeName(ParserInfo info)
|
||||||
{
|
{
|
||||||
var normalizedSeries = Parser.Parser.Normalize(info.Series);
|
var normalizedSeries = Parser.Parser.Normalize(info.Series);
|
||||||
_logger.LogDebug("Checking if we can merge {NormalizedSeries}", normalizedSeries);
|
|
||||||
var existingName =
|
var existingName =
|
||||||
_scannedSeries.SingleOrDefault(p => Parser.Parser.Normalize(p.Key.NormalizedName) == normalizedSeries && p.Key.Format == info.Format)
|
_scannedSeries.SingleOrDefault(p => Parser.Parser.Normalize(p.Key.NormalizedName) == normalizedSeries && p.Key.Format == info.Format)
|
||||||
.Key;
|
.Key;
|
||||||
if (existingName != null && !string.IsNullOrEmpty(existingName.Name))
|
if (existingName != null && !string.IsNullOrEmpty(existingName.Name))
|
||||||
{
|
{
|
||||||
_logger.LogDebug("Found duplicate parsed infos, merged {Original} into {Merged}", info.Series, existingName.Name);
|
|
||||||
return existingName.Name;
|
return existingName.Name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -261,13 +261,15 @@ namespace API.Services.Tasks
|
|||||||
var totalTime = 0L;
|
var totalTime = 0L;
|
||||||
|
|
||||||
// Update existing series
|
// Update existing series
|
||||||
_logger.LogDebug("[ScannerService] Updating existing series");
|
_logger.LogInformation("[ScannerService] Updating existing series for {LibraryName}. Total Items: {TotalSize}. Total Chunks: {TotalChunks} with {ChunkSize} size",
|
||||||
|
library.Name, chunkInfo.TotalSize, chunkInfo.TotalChunks, chunkInfo.ChunkSize);
|
||||||
for (var chunk = 1; chunk <= chunkInfo.TotalChunks; chunk++)
|
for (var chunk = 1; chunk <= chunkInfo.TotalChunks; chunk++)
|
||||||
{
|
{
|
||||||
if (chunkInfo.TotalChunks == 0) continue;
|
if (chunkInfo.TotalChunks == 0) continue;
|
||||||
totalTime += stopwatch.ElapsedMilliseconds;
|
totalTime += stopwatch.ElapsedMilliseconds;
|
||||||
stopwatch.Restart();
|
stopwatch.Restart();
|
||||||
_logger.LogDebug($"[ScannerService] Processing chunk {chunk} / {chunkInfo.TotalChunks} with size {chunkInfo.ChunkSize} Series ({chunk * chunkInfo.ChunkSize} - {(chunk + 1) * chunkInfo.ChunkSize}");
|
_logger.LogInformation("[ScannerService] Processing chunk {ChunkNumber} / {TotalChunks} with size {ChunkSize}. Series ({SeriesStart} - {SeriesEnd}",
|
||||||
|
chunk, chunkInfo.TotalChunks, chunkInfo.ChunkSize, chunk * chunkInfo.ChunkSize, (chunk + 1) * chunkInfo.ChunkSize);
|
||||||
var nonLibrarySeries = await _unitOfWork.SeriesRepository.GetFullSeriesForLibraryIdAsync(library.Id, new UserParams()
|
var nonLibrarySeries = await _unitOfWork.SeriesRepository.GetFullSeriesForLibraryIdAsync(library.Id, new UserParams()
|
||||||
{
|
{
|
||||||
PageNumber = chunk,
|
PageNumber = chunk,
|
||||||
@ -320,12 +322,14 @@ namespace API.Services.Tasks
|
|||||||
_logger.LogDebug("[ScannerService] Adding new series");
|
_logger.LogDebug("[ScannerService] Adding new series");
|
||||||
var newSeries = new List<Series>();
|
var newSeries = new List<Series>();
|
||||||
var allSeries = (await _unitOfWork.SeriesRepository.GetSeriesForLibraryIdAsync(library.Id)).ToList();
|
var allSeries = (await _unitOfWork.SeriesRepository.GetSeriesForLibraryIdAsync(library.Id)).ToList();
|
||||||
|
_logger.LogDebug("[ScannerService] Fetched {AllSeriesCount} series for comparing new series with. There should be {DeltaToParsedSeries} new series",
|
||||||
|
allSeries.Count, parsedSeries.Count - allSeries.Count);
|
||||||
foreach (var (key, infos) in parsedSeries)
|
foreach (var (key, infos) in parsedSeries)
|
||||||
{
|
{
|
||||||
// Key is normalized already
|
// Key is normalized already
|
||||||
Series existingSeries;
|
Series existingSeries;
|
||||||
try
|
try
|
||||||
{
|
{// NOTE: Maybe use .Equals() here
|
||||||
existingSeries = allSeries.SingleOrDefault(s =>
|
existingSeries = allSeries.SingleOrDefault(s =>
|
||||||
(s.NormalizedName == key.NormalizedName || Parser.Parser.Normalize(s.OriginalName) == key.NormalizedName)
|
(s.NormalizedName == key.NormalizedName || Parser.Parser.Normalize(s.OriginalName) == key.NormalizedName)
|
||||||
&& (s.Format == key.Format || s.Format == MangaFormat.Unknown));
|
&& (s.Format == key.Format || s.Format == MangaFormat.Unknown));
|
||||||
@ -386,7 +390,7 @@ namespace API.Services.Tasks
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
_logger.LogDebug(
|
_logger.LogInformation(
|
||||||
"[ScannerService] Added {NewSeries} series in {ElapsedScanTime} milliseconds for {LibraryName}",
|
"[ScannerService] Added {NewSeries} series in {ElapsedScanTime} milliseconds for {LibraryName}",
|
||||||
newSeries.Count, stopwatch.ElapsedMilliseconds, library.Name);
|
newSeries.Count, stopwatch.ElapsedMilliseconds, library.Name);
|
||||||
}
|
}
|
||||||
|
@ -5,7 +5,7 @@
|
|||||||
"TokenKey": "super secret unguessable key",
|
"TokenKey": "super secret unguessable key",
|
||||||
"Logging": {
|
"Logging": {
|
||||||
"LogLevel": {
|
"LogLevel": {
|
||||||
"Default": "Debug",
|
"Default": "Information",
|
||||||
"Microsoft": "Information",
|
"Microsoft": "Information",
|
||||||
"Microsoft.Hosting.Lifetime": "Error",
|
"Microsoft.Hosting.Lifetime": "Error",
|
||||||
"Hangfire": "Information",
|
"Hangfire": "Information",
|
||||||
@ -14,8 +14,8 @@
|
|||||||
"File": {
|
"File": {
|
||||||
"Path": "logs/kavita.log",
|
"Path": "logs/kavita.log",
|
||||||
"Append": "True",
|
"Append": "True",
|
||||||
"FileSizeLimitBytes": 10485760,
|
"FileSizeLimitBytes": 26214400,
|
||||||
"MaxRollingFiles": 5
|
"MaxRollingFiles": 2
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"Port": 5000
|
"Port": 5000
|
||||||
|
@ -56,13 +56,13 @@ export class ManageSettingsComponent implements OnInit {
|
|||||||
async saveSettings() {
|
async saveSettings() {
|
||||||
const modelSettings = this.settingsForm.value;
|
const modelSettings = this.settingsForm.value;
|
||||||
|
|
||||||
if (this.settingsForm.get('enableAuthentication')?.value === false) {
|
if (this.settingsForm.get('enableAuthentication')?.dirty && this.settingsForm.get('enableAuthentication')?.value === false) {
|
||||||
if (!await this.confirmService.confirm('Disabling Authentication opens your server up to unauthorized access and possible hacking. Are you sure you want to continue with this?')) {
|
if (!await this.confirmService.confirm('Disabling Authentication opens your server up to unauthorized access and possible hacking. Are you sure you want to continue with this?')) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const informUserAfterAuthenticationEnabled = this.settingsForm.get('enableAuthentication')?.value && !this.serverSettings.enableAuthentication;
|
const informUserAfterAuthenticationEnabled = this.settingsForm.get('enableAuthentication')?.dirty && this.settingsForm.get('enableAuthentication')?.value && !this.serverSettings.enableAuthentication;
|
||||||
|
|
||||||
this.settingsService.updateServerSettings(modelSettings).pipe(take(1)).subscribe(async (settings: ServerSettings) => {
|
this.settingsService.updateServerSettings(modelSettings).pipe(take(1)).subscribe(async (settings: ServerSettings) => {
|
||||||
this.serverSettings = settings;
|
this.serverSettings = settings;
|
||||||
|
@ -122,7 +122,7 @@
|
|||||||
</button>
|
</button>
|
||||||
<button *ngIf="!this.adhocPageHistory.isEmpty()" class="btn btn-outline-secondary btn-icon col-2 col-xs-1" (click)="goBack()" title="Go Back"><i class="fa fa-reply" aria-hidden="true"></i><span class="phone-hidden"> Go Back</span></button>
|
<button *ngIf="!this.adhocPageHistory.isEmpty()" class="btn btn-outline-secondary btn-icon col-2 col-xs-1" (click)="goBack()" title="Go Back"><i class="fa fa-reply" aria-hidden="true"></i><span class="phone-hidden"> Go Back</span></button>
|
||||||
<button class="btn btn-secondary col-2 col-xs-1" (click)="toggleDrawer()"><i class="fa fa-bars" aria-hidden="true"></i><span class="phone-hidden"> Settings</span></button>
|
<button class="btn btn-secondary col-2 col-xs-1" (click)="toggleDrawer()"><i class="fa fa-bars" aria-hidden="true"></i><span class="phone-hidden"> Settings</span></button>
|
||||||
<div class="book-title col-2 phone-hidden">{{bookTitle}} <span *ngIf="incognitoMode">(<i class="fa fa-glasses" aria-hidden="true"></i><span class="sr-only">Incognito Mode</span>)</span></div>
|
<div class="book-title col-2 phone-hidden">{{bookTitle}} <span *ngIf="incognitoMode" (click)="turnOffIncognito()" role="button" aria-label="Incognito mode is on. Toggle to turn off.">(<i class="fa fa-glasses" aria-hidden="true"></i><span class="sr-only">Incognito Mode</span>)</span></div>
|
||||||
<button class="btn btn-secondary col-2 col-xs-1" (click)="closeReader()"><i class="fa fa-times-circle" aria-hidden="true"></i><span class="phone-hidden"> Close</span></button>
|
<button class="btn btn-secondary col-2 col-xs-1" (click)="closeReader()"><i class="fa fa-times-circle" aria-hidden="true"></i><span class="phone-hidden"> Close</span></button>
|
||||||
<button class="btn btn-outline-secondary btn-icon col-2 col-xs-1"
|
<button class="btn btn-outline-secondary btn-icon col-2 col-xs-1"
|
||||||
[disabled]="IsNextDisabled"
|
[disabled]="IsNextDisabled"
|
||||||
|
@ -995,4 +995,15 @@ export class BookReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
return '';
|
return '';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turns off Incognito mode. This can only happen once if the user clicks the icon. This will modify URL state
|
||||||
|
*/
|
||||||
|
turnOffIncognito() {
|
||||||
|
this.incognitoMode = false;
|
||||||
|
const newRoute = this.readerService.getNextChapterUrl(this.router.url, this.chapterId, this.incognitoMode, this.readingListMode, this.readingListId);
|
||||||
|
window.history.replaceState({}, '', newRoute);
|
||||||
|
this.toastr.info('Incognito mode is off. Progress will now start being tracked.');
|
||||||
|
this.readerService.saveProgress(this.seriesId, this.volumeId, this.chapterId, this.pageNum).pipe(take(1)).subscribe(() => {/* No operation */});
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -13,7 +13,7 @@
|
|||||||
|
|
||||||
<app-carousel-reel [items]="recentlyAdded" title="Recently Added" (sectionClick)="handleSectionClick($event)">
|
<app-carousel-reel [items]="recentlyAdded" title="Recently Added" (sectionClick)="handleSectionClick($event)">
|
||||||
<ng-template #carouselItem let-item let-position="idx">
|
<ng-template #carouselItem let-item let-position="idx">
|
||||||
<app-series-card [data]="item" [libraryId]="item.libraryId" (reload)="reloadTags()" (dataChanged)="loadRecentlyAdded()"></app-series-card>
|
<app-series-card [data]="item" [libraryId]="item.libraryId" (dataChanged)="loadRecentlyAdded()"></app-series-card>
|
||||||
</ng-template>
|
</ng-template>
|
||||||
</app-carousel-reel>
|
</app-carousel-reel>
|
||||||
|
|
||||||
|
@ -6,6 +6,7 @@ import { Subject } from 'rxjs';
|
|||||||
import { take, takeUntil } from 'rxjs/operators';
|
import { take, takeUntil } from 'rxjs/operators';
|
||||||
import { EditCollectionTagsComponent } from '../cards/_modals/edit-collection-tags/edit-collection-tags.component';
|
import { EditCollectionTagsComponent } from '../cards/_modals/edit-collection-tags/edit-collection-tags.component';
|
||||||
import { CollectionTag } from '../_models/collection-tag';
|
import { CollectionTag } from '../_models/collection-tag';
|
||||||
|
import { SeriesAddedEvent } from '../_models/events/series-added-event';
|
||||||
import { InProgressChapter } from '../_models/in-progress-chapter';
|
import { InProgressChapter } from '../_models/in-progress-chapter';
|
||||||
import { Library } from '../_models/library';
|
import { Library } from '../_models/library';
|
||||||
import { Series } from '../_models/series';
|
import { Series } from '../_models/series';
|
||||||
@ -15,6 +16,7 @@ import { Action, ActionFactoryService, ActionItem } from '../_services/action-fa
|
|||||||
import { CollectionTagService } from '../_services/collection-tag.service';
|
import { CollectionTagService } from '../_services/collection-tag.service';
|
||||||
import { ImageService } from '../_services/image.service';
|
import { ImageService } from '../_services/image.service';
|
||||||
import { LibraryService } from '../_services/library.service';
|
import { LibraryService } from '../_services/library.service';
|
||||||
|
import { EVENTS, MessageHubService } from '../_services/message-hub.service';
|
||||||
import { SeriesService } from '../_services/series.service';
|
import { SeriesService } from '../_services/series.service';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
@ -32,17 +34,24 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
recentlyAdded: Series[] = [];
|
recentlyAdded: Series[] = [];
|
||||||
inProgress: Series[] = [];
|
inProgress: Series[] = [];
|
||||||
continueReading: InProgressChapter[] = [];
|
continueReading: InProgressChapter[] = [];
|
||||||
// collectionTags: CollectionTag[] = [];
|
|
||||||
// collectionTagActions: ActionItem<CollectionTag>[] = [];
|
|
||||||
|
|
||||||
private readonly onDestroy = new Subject<void>();
|
private readonly onDestroy = new Subject<void>();
|
||||||
|
|
||||||
seriesTrackBy = (index: number, item: any) => `${item.name}_${item.pagesRead}`;
|
seriesTrackBy = (index: number, item: any) => `${item.name}_${item.pagesRead}`;
|
||||||
|
|
||||||
constructor(public accountService: AccountService, private libraryService: LibraryService,
|
constructor(public accountService: AccountService, private libraryService: LibraryService,
|
||||||
private seriesService: SeriesService, private actionFactoryService: ActionFactoryService,
|
private seriesService: SeriesService, private router: Router,
|
||||||
private collectionService: CollectionTagService, private router: Router,
|
private titleService: Title, public imageService: ImageService,
|
||||||
private modalService: NgbModal, private titleService: Title, public imageService: ImageService) { }
|
private messageHub: MessageHubService) {
|
||||||
|
this.messageHub.messages$.pipe(takeUntil(this.onDestroy)).subscribe(res => {
|
||||||
|
if (res.event == EVENTS.SeriesAdded) {
|
||||||
|
const seriesAddedEvent = res.payload as SeriesAddedEvent;
|
||||||
|
this.seriesService.getSeries(seriesAddedEvent.seriesId).subscribe(series => {
|
||||||
|
this.recentlyAdded.unshift(series);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
this.titleService.setTitle('Kavita - Dashboard');
|
this.titleService.setTitle('Kavita - Dashboard');
|
||||||
@ -56,8 +65,6 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
//this.collectionTagActions = this.actionFactoryService.getCollectionTagActions(this.handleCollectionActionCallback.bind(this));
|
|
||||||
|
|
||||||
this.reloadSeries();
|
this.reloadSeries();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -68,10 +75,7 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
|
|
||||||
reloadSeries() {
|
reloadSeries() {
|
||||||
this.loadRecentlyAdded();
|
this.loadRecentlyAdded();
|
||||||
|
|
||||||
this.loadInProgress();
|
this.loadInProgress();
|
||||||
|
|
||||||
this.reloadTags();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadInProgress(series: Series | boolean) {
|
reloadInProgress(series: Series | boolean) {
|
||||||
@ -85,7 +89,6 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
this.loadInProgress();
|
this.loadInProgress();
|
||||||
this.reloadTags();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
loadInProgress() {
|
loadInProgress() {
|
||||||
@ -100,12 +103,6 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
reloadTags() {
|
|
||||||
// this.collectionService.allTags().pipe(takeUntil(this.onDestroy)).subscribe(tags => {
|
|
||||||
// this.collectionTags = tags;
|
|
||||||
// });
|
|
||||||
}
|
|
||||||
|
|
||||||
handleSectionClick(sectionTitle: string) {
|
handleSectionClick(sectionTitle: string) {
|
||||||
if (sectionTitle.toLowerCase() === 'collections') {
|
if (sectionTitle.toLowerCase() === 'collections') {
|
||||||
this.router.navigate(['collections']);
|
this.router.navigate(['collections']);
|
||||||
@ -115,26 +112,4 @@ export class LibraryComponent implements OnInit, OnDestroy {
|
|||||||
this.router.navigate(['in-progress']);
|
this.router.navigate(['in-progress']);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
loadCollection(item: CollectionTag) {
|
|
||||||
//this.router.navigate(['collections', item.id]);
|
|
||||||
}
|
|
||||||
|
|
||||||
// handleCollectionActionCallback(action: Action, collectionTag: CollectionTag) {
|
|
||||||
// switch (action) {
|
|
||||||
// case(Action.Edit):
|
|
||||||
// const modalRef = this.modalService.open(EditCollectionTagsComponent, { size: 'lg', scrollable: true });
|
|
||||||
// modalRef.componentInstance.tag = collectionTag;
|
|
||||||
// modalRef.closed.subscribe((results: {success: boolean, coverImageUpdated: boolean}) => {
|
|
||||||
// this.reloadTags();
|
|
||||||
// if (results.coverImageUpdated) {
|
|
||||||
// collectionTag.coverImage = this.imageService.randomize(collectionTag.coverImage);
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// break;
|
|
||||||
// default:
|
|
||||||
// break;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
</button>
|
</button>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<div style="font-weight: bold;">{{title}} <span *ngIf="incognitoMode">(<i class="fa fa-glasses" aria-hidden="true"></i><span class="sr-only">Incognito Mode</span>)</span></div>
|
<div style="font-weight: bold;">{{title}} <span class="clickable" *ngIf="incognitoMode" (click)="turnOffIncognito()" role="button" aria-label="Incognito mode is on. Toggle to turn off.">(<i class="fa fa-glasses" aria-hidden="true"></i><span class="sr-only">Incognito Mode:</span>)</span></div>
|
||||||
<div class="subtitle">
|
<div class="subtitle">
|
||||||
{{subtitle}}
|
{{subtitle}}
|
||||||
</div>
|
</div>
|
||||||
|
@ -1113,4 +1113,15 @@ export class MangaReaderComponent implements OnInit, AfterViewInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Turns off Incognito mode. This can only happen once if the user clicks the icon. This will modify URL state
|
||||||
|
*/
|
||||||
|
turnOffIncognito() {
|
||||||
|
this.incognitoMode = false;
|
||||||
|
const newRoute = this.readerService.getNextChapterUrl(this.router.url, this.chapterId, this.incognitoMode, this.readingListMode, this.readingListId);
|
||||||
|
window.history.replaceState({}, '', newRoute);
|
||||||
|
this.toastr.info('Incognito mode is off. Progress will now start being tracked.');
|
||||||
|
this.readerService.saveProgress(this.seriesId, this.volumeId, this.chapterId, this.pageNum).pipe(take(1)).subscribe(() => {/* No operation */});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user