Skip to content

Commit

Permalink
Release Polishing (Kareadita#2325)
Browse files Browse the repository at this point in the history
Co-authored-by: Robbie Davis <[email protected]>
  • Loading branch information
majora2007 and therobbiedavis authored Oct 18, 2023
1 parent 2d3a0c1 commit 8e85ba0
Show file tree
Hide file tree
Showing 28 changed files with 88 additions and 96 deletions.
1 change: 0 additions & 1 deletion API/API.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@

<ItemGroup>
<PackageReference Include="AutoMapper.Extensions.Microsoft.DependencyInjection" Version="12.0.1" />
<PackageReference Include="CsvHelper" Version="30.0.1" />
<PackageReference Include="Docnet.Core" Version="2.6.0" />
<PackageReference Include="EasyCaching.InMemory" Version="1.9.1" />
<PackageReference Include="ExCSS" Version="4.2.2" />
Expand Down
1 change: 1 addition & 0 deletions API/Controllers/AccountController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ public async Task<ActionResult<UserDto>> RefreshAccount()
dto.RefreshToken = await _tokenService.CreateRefreshToken(user);
dto.KavitaVersion = (await _unitOfWork.SettingsRepository.GetSettingAsync(ServerSettingKey.InstallVersion))
.Value;
dto.Preferences = _mapper.Map<UserPreferencesDto>(user.UserPreferences);
return Ok(dto);
}

Expand Down
6 changes: 1 addition & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ your reading collection with your friends and family!
- Ability to manage users with rich Role-based management for age restrictions, abilities within the app, etc
- Rich web readers supporting webtoon, continuous reading mode (continue without leaving the reader), virtual pages (epub), etc
- Full Localization Support
- Ability to customize your dashboard and side nav with smart filters
- Ability to customize your dashboard and side nav with smart filters, custom order and visibility toggles.


## Support
Expand Down Expand Up @@ -110,10 +110,6 @@ Thank you to [Weblate](https://hosted.weblate.org/engage/kavita/) who hosts our
<img src="https://hosted.weblate.org/widgets/kavita/-/horizontal-blue.svg" alt="Translation status" />
</a>

## Huntr
We would like to extend a big thank you to [Huntr](https://huntr.dev/repos/kareadita/kavita) who has worked with Kavita in reporting security vulnerabilities. If you are interested in
being paid to help secure Kavita, please give them a try.

## PikaPods
If you are looking to try your hand at self-hosting but lack the machine, [PikaPods](https://www.pikapods.com/pods?run=kavita) is a great service that
allows you to easily spin up a server. 20% of app revenues are contributed back to Kavita via OpenCollective.
Expand Down
2 changes: 1 addition & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ Security is maintained on latest stable version only.
## Reporting a Vulnerability


Please reach out to majora2007 via our Discord or you can (and should) report your vulnerability via [Huntr](https://huntr.dev/repos/kareadita/kavita).
Please reach out to majora2007 via our Discord or you can (and should) report your vulnerability via Github Security Disclosure.
45 changes: 22 additions & 23 deletions UI/Web/src/app/_services/action.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,7 @@ export class ActionService implements OnDestroy {

constructor(private libraryService: LibraryService, private seriesService: SeriesService,
private readerService: ReaderService, private toastr: ToastrService, private modalService: NgbModal,
private confirmService: ConfirmService, private memberService: MemberService, private deviceService: DeviceService,
private translocoService: TranslocoService) { }
private confirmService: ConfirmService, private memberService: MemberService, private deviceService: DeviceService) { }

ngOnDestroy() {
this.onDestroy.next();
Expand All @@ -66,7 +65,7 @@ export class ActionService implements OnDestroy {
const force = false; // await this.promptIfForce();

this.libraryService.scan(library.id, force).pipe(take(1)).subscribe((res: any) => {
this.toastr.info(this.translocoService.translate('toasts.scan-queued', {name: library.name}));
this.toastr.info(translate('toasts.scan-queued', {name: library.name}));
if (callback) {
callback(library);
}
Expand Down Expand Up @@ -95,7 +94,7 @@ export class ActionService implements OnDestroy {
const forceUpdate = true; //await this.promptIfForce();

this.libraryService.refreshMetadata(library?.id, forceUpdate).pipe(take(1)).subscribe((res: any) => {
this.toastr.info(this.translocoService.translate('toasts.scan-queued', {name: library.name}));
this.toastr.info(translate('toasts.scan-queued', {name: library.name}));
if (callback) {
callback(library);
}
Expand Down Expand Up @@ -129,7 +128,7 @@ export class ActionService implements OnDestroy {
}

this.libraryService.analyze(library?.id).pipe(take(1)).subscribe((res: any) => {
this.toastr.info(this.translocoService.translate('toasts.library-file-analysis-queued', {name: library.name}));
this.toastr.info(translate('toasts.library-file-analysis-queued', {name: library.name}));
if (callback) {
callback(library);
}
Expand All @@ -144,7 +143,7 @@ export class ActionService implements OnDestroy {
markSeriesAsRead(series: Series, callback?: SeriesActionCallback) {
this.seriesService.markRead(series.id).pipe(take(1)).subscribe(res => {
series.pagesRead = series.pages;
this.toastr.success(this.translocoService.translate('toasts.entity-read', {name: series.name}));
this.toastr.success(translate('toasts.entity-read', {name: series.name}));
if (callback) {
callback(series);
}
Expand All @@ -159,7 +158,7 @@ export class ActionService implements OnDestroy {
markSeriesAsUnread(series: Series, callback?: SeriesActionCallback) {
this.seriesService.markUnread(series.id).pipe(take(1)).subscribe(res => {
series.pagesRead = 0;
this.toastr.success(this.translocoService.translate('toasts.entity-unread', {name: series.name}));
this.toastr.success(translate('toasts.entity-unread', {name: series.name}));
if (callback) {
callback(series);
}
Expand All @@ -173,7 +172,7 @@ export class ActionService implements OnDestroy {
*/
async scanSeries(series: Series, callback?: SeriesActionCallback) {
this.seriesService.scan(series.libraryId, series.id).pipe(take(1)).subscribe((res: any) => {
this.toastr.info(this.translocoService.translate('toasts.scan-queued', {name: series.name}));
this.toastr.info(translate('toasts.scan-queued', {name: series.name}));
if (callback) {
callback(series);
}
Expand All @@ -187,7 +186,7 @@ export class ActionService implements OnDestroy {
*/
analyzeFilesForSeries(series: Series, callback?: SeriesActionCallback) {
this.seriesService.analyzeFiles(series.libraryId, series.id).pipe(take(1)).subscribe((res: any) => {
this.toastr.info(this.translocoService.translate('toasts.scan-queued', {name: series.name}));
this.toastr.info(translate('toasts.scan-queued', {name: series.name}));
if (callback) {
callback(series);
}
Expand All @@ -208,7 +207,7 @@ export class ActionService implements OnDestroy {
}

this.seriesService.refreshMetadata(series).pipe(take(1)).subscribe((res: any) => {
this.toastr.info(this.translocoService.translate('toasts.refresh-covers-queued', {name: series.name}));
this.toastr.info(translate('toasts.refresh-covers-queued', {name: series.name}));
if (callback) {
callback(series);
}
Expand All @@ -225,7 +224,7 @@ export class ActionService implements OnDestroy {
this.readerService.markVolumeRead(seriesId, volume.id).pipe(take(1)).subscribe(() => {
volume.pagesRead = volume.pages;
volume.chapters?.forEach(c => c.pagesRead = c.pages);
this.toastr.success(this.translocoService.translate('toasts.mark-read'));
this.toastr.success(translate('toasts.mark-read'));

if (callback) {
callback(volume);
Expand All @@ -243,7 +242,7 @@ export class ActionService implements OnDestroy {
this.readerService.markVolumeUnread(seriesId, volume.id).subscribe(() => {
volume.pagesRead = 0;
volume.chapters?.forEach(c => c.pagesRead = 0);
this.toastr.success(this.translocoService.translate('toasts.mark-unread'));
this.toastr.success(translate('toasts.mark-unread'));
if (callback) {
callback(volume);
}
Expand All @@ -259,7 +258,7 @@ export class ActionService implements OnDestroy {
markChapterAsRead(libraryId: number, seriesId: number, chapter: Chapter, callback?: ChapterActionCallback) {
this.readerService.saveProgress(libraryId, seriesId, chapter.volumeId, chapter.id, chapter.pages).pipe(take(1)).subscribe(results => {
chapter.pagesRead = chapter.pages;
this.toastr.success(this.translocoService.translate('toasts.mark-read'));
this.toastr.success(translate('toasts.mark-read'));
if (callback) {
callback(chapter);
}
Expand All @@ -275,7 +274,7 @@ export class ActionService implements OnDestroy {
markChapterAsUnread(libraryId: number, seriesId: number, chapter: Chapter, callback?: ChapterActionCallback) {
this.readerService.saveProgress(libraryId, seriesId, chapter.volumeId, chapter.id, 0).pipe(take(1)).subscribe(results => {
chapter.pagesRead = 0;
this.toastr.success(this.translocoService.translate('toasts.mark-unread'));
this.toastr.success(translate('toasts.mark-unread'));
if (callback) {
callback(chapter);
}
Expand All @@ -296,7 +295,7 @@ export class ActionService implements OnDestroy {
volume.chapters?.forEach(c => c.pagesRead = c.pages);
});
chapters?.forEach(c => c.pagesRead = c.pages);
this.toastr.success(this.translocoService.translate('toasts.mark-read'));
this.toastr.success(translate('toasts.mark-read'));

if (callback) {
callback();
Expand All @@ -317,7 +316,7 @@ export class ActionService implements OnDestroy {
volume.chapters?.forEach(c => c.pagesRead = 0);
});
chapters?.forEach(c => c.pagesRead = 0);
this.toastr.success(this.translocoService.translate('toasts.mark-unread'));
this.toastr.success(translate('toasts.mark-unread'));

if (callback) {
callback();
Expand All @@ -335,7 +334,7 @@ export class ActionService implements OnDestroy {
series.forEach(s => {
s.pagesRead = s.pages;
});
this.toastr.success(this.translocoService.translate('toasts.mark-read'));
this.toastr.success(translate('toasts.mark-read'));

if (callback) {
callback();
Expand All @@ -353,7 +352,7 @@ export class ActionService implements OnDestroy {
series.forEach(s => {
s.pagesRead = s.pages;
});
this.toastr.success(this.translocoService.translate('toasts.mark-unread'));
this.toastr.success(translate('toasts.mark-unread'));

if (callback) {
callback();
Expand Down Expand Up @@ -396,7 +395,7 @@ export class ActionService implements OnDestroy {

removeMultipleSeriesFromWantToReadList(seriesIds: Array<number>, callback?: VoidActionCallback) {
this.memberService.removeSeriesToWantToRead(seriesIds).subscribe(() => {
this.toastr.success(this.translocoService.translate('toasts.series-removed-want-to-read'));
this.toastr.success(translate('toasts.series-removed-want-to-read'));
if (callback) {
callback();
}
Expand Down Expand Up @@ -547,7 +546,7 @@ export class ActionService implements OnDestroy {
return;
}
this.seriesService.deleteMultipleSeries(seriesIds.map(s => s.id)).pipe(take(1)).subscribe(() => {
this.toastr.success(this.translocoService.translate('toasts.series-deleted'));
this.toastr.success(translate('toasts.series-deleted'));

if (callback) {
callback(true);
Expand All @@ -565,15 +564,15 @@ export class ActionService implements OnDestroy {

this.seriesService.delete(series.id).subscribe((res: boolean) => {
if (callback) {
this.toastr.success(this.translocoService.translate('toasts.series-deleted'));
this.toastr.success(translate('toasts.series-deleted'));
callback(res);
}
});
}

sendToDevice(chapterIds: Array<number>, device: Device, callback?: VoidActionCallback) {
this.deviceService.sendTo(chapterIds, device.id).subscribe(() => {
this.toastr.success(this.translocoService.translate('toasts.file-send-to', {name: device.name}));
this.toastr.success(translate('toasts.file-send-to', {name: device.name}));
if (callback) {
callback();
}
Expand All @@ -582,7 +581,7 @@ export class ActionService implements OnDestroy {

sendSeriesToDevice(seriesId: number, device: Device, callback?: VoidActionCallback) {
this.deviceService.sendSeriesTo(seriesId, device.id).subscribe(() => {
this.toastr.success(this.translocoService.translate('toasts.file-send-to', {name: device.name}));
this.toastr.success(translate('toasts.file-send-to', {name: device.name}));
if (callback) {
callback();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,7 @@
.muted {
font-size: 14px;
}

a.read-more-link {
white-space: nowrap;
}
4 changes: 1 addition & 3 deletions UI/Web/src/app/app.component.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import {Component, DestroyRef, HostListener, inject, Inject, OnInit} from '@angular/core';
import { NavigationStart, Router, RouterOutlet } from '@angular/router';
import {map, pluck, shareReplay, take} from 'rxjs/operators';
import {map, shareReplay, take} from 'rxjs/operators';
import { AccountService } from './_services/account.service';
import { LibraryService } from './_services/library.service';
import { NavService } from './_services/nav.service';
Expand All @@ -12,7 +12,6 @@ import {ThemeService} from "./_services/theme.service";
import { SideNavComponent } from './sidenav/_components/side-nav/side-nav.component';
import {NavHeaderComponent} from "./nav/_components/nav-header/nav-header.component";
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
import {translate, TranslocoService} from "@ngneat/transloco";

@Component({
selector: 'app-root',
Expand All @@ -26,7 +25,6 @@ export class AppComponent implements OnInit {
transitionState$!: Observable<boolean>;

destroyRef = inject(DestroyRef);
translocoService = inject(TranslocoService);

constructor(private accountService: AccountService, public navService: NavService,
private libraryService: LibraryService,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { ReadingList } from 'src/app/_models/reading-list';
import { CollectionTagService } from 'src/app/_services/collection-tag.service';
import {CommonModule} from "@angular/common";
import {FilterPipe} from "../../../pipe/filter.pipe";
import {TranslocoDirective, TranslocoService} from "@ngneat/transloco";
import {translate, TranslocoDirective, TranslocoService} from "@ngneat/transloco";

@Component({
selector: 'app-bulk-add-to-collection',
Expand Down Expand Up @@ -46,7 +46,6 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {

collectionTitleTrackby = (index: number, item: CollectionTag) => `${item.title}`;

translocoService = inject(TranslocoService);

@ViewChild('title') inputElem!: ElementRef<HTMLInputElement>;

Expand Down Expand Up @@ -83,7 +82,7 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {
create() {
const tagName = this.listForm.value.title;
this.collectionService.addByMultiple(0, this.seriesIds, tagName).subscribe(() => {
this.toastr.success(this.translocoService.translate('toasts.series-added-to-collection', {collectionName: tagName}));
this.toastr.success(translate('toasts.series-added-to-collection', {collectionName: tagName}));
this.modal.close();
});
}
Expand All @@ -92,7 +91,7 @@ export class BulkAddToCollectionComponent implements OnInit, AfterViewInit {
if (this.seriesIds.length === 0) return;

this.collectionService.addByMultiple(tag.id, this.seriesIds, '').subscribe(() => {
this.toastr.success(this.translocoService.translate('toasts.series-added-to-collection', {collectionName: tag.title}));
this.toastr.success(translate('toasts.series-added-to-collection', {collectionName: tag.title}));
this.modal.close();
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ import { UploadService } from 'src/app/_services/upload.service';
import {takeUntilDestroyed} from "@angular/core/rxjs-interop";
import {CommonModule} from "@angular/common";
import {CoverImageChooserComponent} from "../../cover-image-chooser/cover-image-chooser.component";
import {TranslocoDirective, TranslocoService} from "@ngneat/transloco";
import {translate, TranslocoDirective, TranslocoService} from "@ngneat/transloco";


enum TabID {
Expand Down Expand Up @@ -65,7 +65,6 @@ export class EditCollectionTagsComponent implements OnInit {
imageUrls: Array<string> = [];
selectedCover: string = '';
private readonly destroyRef = inject(DestroyRef);
translocoService = inject(TranslocoService);

get hasSomeSelected() {
return this.selections != null && this.selections.hasSomeSelected();
Expand Down Expand Up @@ -172,7 +171,7 @@ export class EditCollectionTagsComponent implements OnInit {
tag.id = this.tag.id;

if (unselectedIds.length == this.series.length &&
!await this.confirmService.confirm(this.translocoService.translate('toasts.no-series-collection-warning'))) {
!await this.confirmService.confirm(translate('toasts.no-series-collection-warning'))) {
return;
}

Expand All @@ -187,7 +186,7 @@ export class EditCollectionTagsComponent implements OnInit {

forkJoin(apis).subscribe(() => {
this.modal.close({success: true, coverImageUpdated: selectedIndex > 0});
this.toastr.success(this.translocoService.translate('toasts.collection-updated'));
this.toastr.success(translate('toasts.collection-updated'));
});
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ import {BytesPipe} from "../../pipe/bytes.pipe";
import {BadgeExpanderComponent} from "../../shared/badge-expander/badge-expander.component";
import {TagBadgeComponent} from "../../shared/tag-badge/tag-badge.component";
import {PersonBadgeComponent} from "../../shared/person-badge/person-badge.component";
import {TranslocoDirective, TranslocoService} from "@ngneat/transloco";
import {translate, TranslocoDirective, TranslocoService} from "@ngneat/transloco";
import {CardActionablesComponent} from "../../_single-module/card-actionables/card-actionables.component";

enum TabID {
Expand All @@ -73,7 +73,6 @@ export class CardDetailDrawerComponent implements OnInit {
@Input() libraryId: number = 0;
@Input({required: true}) data!: Volume | Chapter;
private readonly destroyRef = inject(DestroyRef);
private readonly translocoService = inject(TranslocoService);


/**
Expand Down Expand Up @@ -209,7 +208,7 @@ export class CardDetailDrawerComponent implements OnInit {

resetCoverImage() {
this.uploadService.resetChapterCoverLock(this.chapter.id).subscribe(() => {
this.toastr.info(this.translocoService.translate('toasts.regen-cover'));
this.toastr.info(translate('toasts.regen-cover'));
});
}

Expand Down Expand Up @@ -262,7 +261,7 @@ export class CardDetailDrawerComponent implements OnInit {

readChapter(chapter: Chapter, incognito: boolean = false) {
if (chapter.pages === 0) {
this.toastr.error(this.translocoService.translate('toasts.no-pages'));
this.toastr.error(translate('toasts.no-pages'));
return;
}

Expand All @@ -273,7 +272,7 @@ export class CardDetailDrawerComponent implements OnInit {

download(chapter: Chapter) {
if (this.downloadInProgress) {
this.toastr.info(this.translocoService.translate('toasts.download-in-progress'));
this.toastr.info(translate('toasts.download-in-progress'));
return;
}

Expand Down
Loading

0 comments on commit 8e85ba0

Please sign in to comment.