Polish for Release (#3714)
This commit is contained in:
parent
9d9938bce2
commit
c80d046fc7
20 changed files with 3611 additions and 41 deletions
|
@ -1,16 +1,16 @@
|
|||
import { AgeRestriction } from '../metadata/age-restriction';
|
||||
import { Library } from '../library/library';
|
||||
import {AgeRestriction} from '../metadata/age-restriction';
|
||||
import {Library} from '../library/library';
|
||||
|
||||
export interface Member {
|
||||
id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
lastActive: string; // datetime
|
||||
lastActiveUtc: string; // datetime
|
||||
created: string; // datetime
|
||||
createdUtc: string; // datetime
|
||||
roles: string[];
|
||||
libraries: Library[];
|
||||
ageRestriction: AgeRestriction;
|
||||
isPending: boolean;
|
||||
id: number;
|
||||
username: string;
|
||||
email: string;
|
||||
lastActive: string; // datetime
|
||||
lastActiveUtc: string; // datetime
|
||||
created: string; // datetime
|
||||
createdUtc: string; // datetime
|
||||
roles: string[];
|
||||
libraries: Library[];
|
||||
ageRestriction: AgeRestriction;
|
||||
isPending: boolean;
|
||||
}
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
import { AgeRestriction } from './metadata/age-restriction';
|
||||
import { Preferences } from './preferences/preferences';
|
||||
import {AgeRestriction} from './metadata/age-restriction';
|
||||
import {Preferences} from './preferences/preferences';
|
||||
|
||||
// This interface is only used for login and storing/retrieving JWT from local storage
|
||||
export interface User {
|
||||
username: string;
|
||||
token: string;
|
||||
refreshToken: string;
|
||||
roles: string[];
|
||||
preferences: Preferences;
|
||||
apiKey: string;
|
||||
email: string;
|
||||
ageRestriction: AgeRestriction;
|
||||
username: string;
|
||||
token: string;
|
||||
refreshToken: string;
|
||||
roles: string[];
|
||||
preferences: Preferences;
|
||||
apiKey: string;
|
||||
email: string;
|
||||
ageRestriction: AgeRestriction;
|
||||
hasRunScrobbleEventGeneration: boolean;
|
||||
scrobbleEventGenerationRan: string; // datetime
|
||||
}
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { HttpClient, HttpParams } from '@angular/common/http';
|
||||
import {HttpClient, HttpParams} from '@angular/common/http';
|
||||
import {Injectable} from '@angular/core';
|
||||
import { map } from 'rxjs/operators';
|
||||
import { environment } from 'src/environments/environment';
|
||||
import { TextResonse } from '../_types/text-response';
|
||||
import {map} from 'rxjs/operators';
|
||||
import {environment} from 'src/environments/environment';
|
||||
import {TextResonse} from '../_types/text-response';
|
||||
import {ScrobbleError} from "../_models/scrobbling/scrobble-error";
|
||||
import {ScrobbleEvent} from "../_models/scrobbling/scrobble-event";
|
||||
import {ScrobbleHold} from "../_models/scrobbling/scrobble-hold";
|
||||
|
@ -56,6 +56,11 @@ export class ScrobblingService {
|
|||
return this.httpClient.get<{username: string, accessToken: string}>(this.baseUrl + 'scrobbling/mal-token');
|
||||
}
|
||||
|
||||
|
||||
hasRunScrobbleGen() {
|
||||
return this.httpClient.get(this.baseUrl + 'scrobbling/has-ran-scrobble-gen ', TextResonse).pipe(map(r => r === 'true'));
|
||||
}
|
||||
|
||||
getScrobbleErrors() {
|
||||
return this.httpClient.get<Array<ScrobbleError>>(this.baseUrl + 'scrobbling/scrobble-errors');
|
||||
}
|
||||
|
|
|
@ -30,8 +30,8 @@ export class VersionService implements OnDestroy{
|
|||
|
||||
// Check intervals
|
||||
private readonly VERSION_CHECK_INTERVAL = 30 * 60 * 1000; // 30 minutes
|
||||
private readonly OUT_OF_DATE_CHECK_INTERVAL = this.VERSION_CHECK_INTERVAL; // 2 * 60 * 60 * 1000; // 2 hours
|
||||
private readonly OUT_Of_BAND_AMOUNT = 2; // How many releases before we show "You're X releases out of date"
|
||||
private readonly OUT_OF_DATE_CHECK_INTERVAL = 2 * 60 * 60 * 1000; // 2 hours
|
||||
private readonly OUT_Of_BAND_AMOUNT = 3; // How many releases before we show "You're X releases out of date"
|
||||
|
||||
// Routes where version update modals should not be shown
|
||||
private readonly EXCLUDED_ROUTES = [
|
||||
|
|
|
@ -1,14 +1,16 @@
|
|||
<ng-container *transloco="let t; read:'user-scrobble-history'">
|
||||
|
||||
@let currentUser = accountService.currentUser$ | async;
|
||||
|
||||
<div class="position-relative">
|
||||
<button class="btn btn-outline-primary position-absolute custom-position" [disabled]="events.length > 0" (click)="generateScrobbleEvents()" [title]="t('generate-scrobble-events')">
|
||||
<button class="btn btn-outline-primary position-absolute custom-position" [disabled]="hasRunScrobbleGen" (click)="generateScrobbleEvents()" [title]="t('generate-scrobble-events')">
|
||||
<i class="fa fa-plus" aria-hidden="true"></i><span class="phone-hidden ms-1">{{t('generate-scrobble-events')}}</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (tokenExpired) {
|
||||
<p class="alert alert-warning">{{t('token-expired')}}</p>
|
||||
} @else if (!(accountService.currentUser$ | async)!.preferences.aniListScrobblingEnabled) {
|
||||
} @else if (!currentUser!.preferences.aniListScrobblingEnabled) {
|
||||
<p class="alert alert-warning">{{t('scrobbling-disabled')}}</p>
|
||||
}
|
||||
|
||||
|
|
|
@ -29,8 +29,8 @@ export interface DataTablePage {
|
|||
|
||||
@Component({
|
||||
selector: 'app-user-scrobble-history',
|
||||
imports: [ScrobbleEventTypePipe, ReactiveFormsModule, TranslocoModule,
|
||||
DefaultValuePipe, TranslocoLocaleModule, UtcToLocalTimePipe, NgbTooltip, NgxDatatableModule, AsyncPipe],
|
||||
imports: [ScrobbleEventTypePipe, ReactiveFormsModule, TranslocoModule,
|
||||
DefaultValuePipe, TranslocoLocaleModule, UtcToLocalTimePipe, NgbTooltip, NgxDatatableModule, AsyncPipe],
|
||||
templateUrl: './user-scrobble-history.component.html',
|
||||
styleUrls: ['./user-scrobble-history.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush
|
||||
|
@ -66,12 +66,18 @@ export class UserScrobbleHistoryComponent implements OnInit {
|
|||
column: 'lastModifiedUtc',
|
||||
direction: 'desc'
|
||||
};
|
||||
hasRunScrobbleGen: boolean = false;
|
||||
|
||||
ngOnInit() {
|
||||
|
||||
this.pageInfo.pageNumber = 0;
|
||||
this.cdRef.markForCheck();
|
||||
|
||||
this.scrobblingService.hasRunScrobbleGen().subscribe(res => {
|
||||
this.hasRunScrobbleGen = res;
|
||||
this.cdRef.markForCheck();
|
||||
})
|
||||
|
||||
this.scrobblingService.hasTokenExpired(ScrobbleProvider.AniList).subscribe(hasExpired => {
|
||||
this.tokenExpired = hasExpired;
|
||||
this.cdRef.markForCheck();
|
||||
|
|
|
@ -7,7 +7,11 @@
|
|||
<div class="d-flex list-container">
|
||||
<ng-container [ngTemplateOutlet]="handle" [ngTemplateOutletContext]="{ $implicit: item, idx: i, isVirtualized: true }"></ng-container>
|
||||
<ng-container [ngTemplateOutlet]="itemTemplate" [ngTemplateOutletContext]="{ $implicit: item, idx: i }"></ng-container>
|
||||
<ng-container [ngTemplateOutlet]="removeBtn" [ngTemplateOutletContext]="{$implicit: item, idx: i}"></ng-container>
|
||||
|
||||
@if (showRemoveButton) {
|
||||
<ng-container [ngTemplateOutlet]="removeBtn" [ngTemplateOutletContext]="{$implicit: item, idx: i}"></ng-container>
|
||||
}
|
||||
|
||||
</div>
|
||||
</div>
|
||||
}
|
||||
|
|
|
@ -233,9 +233,13 @@
|
|||
|
||||
<app-draggable-ordered-list [items]="items" (orderUpdated)="orderUpdated($event)" [accessibilityMode]="accessibilityMode"
|
||||
[disabled]="!(formGroup.get('edit')?.value || false)" [showRemoveButton]="formGroup.get('edit')?.value || false">
|
||||
|
||||
<ng-template #draggableItem let-item let-position="idx">
|
||||
<app-reading-list-item [ngClass]="{'content-container': items.length < 100, 'non-virtualized-container': items.length >= 100}" [item]="item" [position]="position" [libraryTypes]="libraryTypes"
|
||||
[promoted]="item.promoted" (read)="readChapter($event)" (remove)="itemRemoved($event, position)" [showRead]="!(formGroup.get('edit')?.value || false)"></app-reading-list-item>
|
||||
<app-reading-list-item [ngClass]="{'content-container': items.length < 100, 'non-virtualized-container': items.length >= 100}" [item]="item"
|
||||
[position]="position" [libraryTypes]="libraryTypes"
|
||||
[promoted]="item.promoted" (read)="readChapter($event)"
|
||||
(remove)="itemRemoved($event, position)"
|
||||
[showRemove]="false"/>
|
||||
</ng-template>
|
||||
</app-draggable-ordered-list>
|
||||
</div>
|
||||
|
|
|
@ -14,8 +14,6 @@
|
|||
|
||||
.non-virtualized-container {
|
||||
width: 100%;
|
||||
max-height: 140px;
|
||||
height: 140px;
|
||||
}
|
||||
|
||||
.dropdown-toggle-split {
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<ng-container *transloco="let t; read: 'reading-list-item'">
|
||||
<div class="d-flex flex-row g-0 mb-2 reading-list-item">
|
||||
<div class="d-flex flex-row g-0reading-list-item">
|
||||
<div class="d-none d-md-block pe-2">
|
||||
<app-image width="106px" [styles]="{'max-height': '125px'}" class="img-top me-3" [imageUrl]="imageService.getChapterCoverImage(item.chapterId)"></app-image>
|
||||
@if (item.pagesRead === 0 && item.pagesTotal > 0) {
|
||||
|
@ -42,7 +42,7 @@
|
|||
<a href="/library/{{item.libraryId}}/series/{{item.seriesId}}">{{item.seriesName}}</a>
|
||||
</div>
|
||||
|
||||
<app-read-more [text]="item.summary || ''"></app-read-more>
|
||||
<app-read-more [text]="item.summary || ''" [showToggle]="false" [maxLength]="500"></app-read-more>
|
||||
|
||||
|
||||
@if (item.releaseDate !== '0001-01-01T00:00:00') {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue