This commit is contained in:
+11
-11
@@ -21,7 +21,7 @@
|
|||||||
<p-tablist>
|
<p-tablist>
|
||||||
@for (tab of tabConfigs; track tab.type) {
|
@for (tab of tabConfigs; track tab.type) {
|
||||||
<p-tab [value]="tab.type">
|
<p-tab [value]="tab.type">
|
||||||
<i class="pi {{ tab.icon }}"></i> {{ t(tab.labelKey).endsWith('s') ? t(tab.labelKey) : t(tab.labelKey) + 's' }} ({{ getMetadataItems(tab.type).length }})
|
<i class="pi {{ tab.icon }}"></i> {{ t(tab.labelPluralKey) }} ({{ getMetadataItems(tab.type).length }})
|
||||||
</p-tab>
|
</p-tab>
|
||||||
}
|
}
|
||||||
</p-tablist>
|
</p-tablist>
|
||||||
@@ -160,13 +160,13 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p-dialog
|
<p-dialog
|
||||||
[header]="t('mergeSplitDialogTitle', { type: currentMergeType | titlecase })"
|
[header]="t('mergeSplitDialogTitle', { type: getTypeLabel(currentMergeType, true) })"
|
||||||
[(visible)]="showMergeDialog"
|
[(visible)]="showMergeDialog"
|
||||||
[modal]="true"
|
[modal]="true"
|
||||||
class="user-dialog"
|
class="user-dialog"
|
||||||
[style]="{width: '50rem'}">
|
[style]="{width: '50rem'}">
|
||||||
<div class="dialog-form">
|
<div class="dialog-form">
|
||||||
<p>{{ t('mergeSplitDescription', { count: getSelectedItems(currentMergeType).length, type: currentMergeType }) }}</p>
|
<p>{{ t('mergeSplitDescription', { count: getSelectedItems(currentMergeType).length, type: getTypeLabel(currentMergeType, true) }) }}</p>
|
||||||
<ul class="selected-items">
|
<ul class="selected-items">
|
||||||
@for (item of getSelectedItems(currentMergeType); track item.value) {
|
@for (item of getSelectedItems(currentMergeType); track item.value) {
|
||||||
<li>
|
<li>
|
||||||
@@ -185,9 +185,9 @@
|
|||||||
class="full-width-input"
|
class="full-width-input"
|
||||||
[placeholder]="isSingleValueField(currentMergeType) ? t('singleValuePlaceholder') : t('multiValuePlaceholder')"/>
|
[placeholder]="isSingleValueField(currentMergeType) ? t('singleValuePlaceholder') : t('multiValuePlaceholder')"/>
|
||||||
@if (isSingleValueField(currentMergeType)) {
|
@if (isSingleValueField(currentMergeType)) {
|
||||||
<small class="help-text" [innerHTML]="t('singleMergeHowItWorks', { type: currentMergeType, singular: currentMergeType.slice(0, -1) })"></small>
|
<small class="help-text" [innerHTML]="t('singleMergeHowItWorks', { type: getTypeLabel(currentMergeType, true), singular: getTypeLabel(currentMergeType, false) })"></small>
|
||||||
} @else {
|
} @else {
|
||||||
<small class="help-text" [innerHTML]="t('multiMergeHowItWorks', { type: currentMergeType })"></small>
|
<small class="help-text" [innerHTML]="t('multiMergeHowItWorks', { type: getTypeLabel(currentMergeType, true) })"></small>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@if (mergingInProgress) {
|
@if (mergingInProgress) {
|
||||||
@@ -219,7 +219,7 @@
|
|||||||
</p-dialog>
|
</p-dialog>
|
||||||
|
|
||||||
<p-dialog
|
<p-dialog
|
||||||
[header]="t('renameSplitDialogTitle', { type: currentMergeType | titlecase })"
|
[header]="t('renameSplitDialogTitle', { type: getTypeLabel(currentMergeType, true) })"
|
||||||
[(visible)]="showRenameDialog"
|
[(visible)]="showRenameDialog"
|
||||||
[modal]="true"
|
[modal]="true"
|
||||||
class="user-dialog"
|
class="user-dialog"
|
||||||
@@ -242,9 +242,9 @@
|
|||||||
[placeholder]="isSingleValueField(currentMergeType) ? t('singleRenamePlaceholder') : t('multiRenamePlaceholder')"
|
[placeholder]="isSingleValueField(currentMergeType) ? t('singleRenamePlaceholder') : t('multiRenamePlaceholder')"
|
||||||
(keyup.enter)="confirmRename()"/>
|
(keyup.enter)="confirmRename()"/>
|
||||||
@if (isSingleValueField(currentMergeType)) {
|
@if (isSingleValueField(currentMergeType)) {
|
||||||
<small class="help-text" [innerHTML]="t('singleRenameHowItWorks', { singular: currentMergeType.slice(0, -1) })"></small>
|
<small class="help-text" [innerHTML]="t('singleRenameHowItWorks', { singular: getTypeLabel(currentMergeType, false) })"></small>
|
||||||
} @else {
|
} @else {
|
||||||
<small class="help-text" [innerHTML]="t('multiRenameHowItWorks', { singular: currentMergeType.slice(0, -1), type: currentMergeType })"></small>
|
<small class="help-text" [innerHTML]="t('multiRenameHowItWorks', { singular: getTypeLabel(currentMergeType, false), type: getTypeLabel(currentMergeType, true) })"></small>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
@if (mergingInProgress) {
|
@if (mergingInProgress) {
|
||||||
@@ -276,7 +276,7 @@
|
|||||||
</p-dialog>
|
</p-dialog>
|
||||||
|
|
||||||
<p-dialog
|
<p-dialog
|
||||||
[header]="t('deleteDialogTitle', { type: currentMergeType | titlecase })"
|
[header]="t('deleteDialogTitle', { type: getTypeLabel(currentMergeType, true) })"
|
||||||
[(visible)]="showDeleteDialog"
|
[(visible)]="showDeleteDialog"
|
||||||
[modal]="true"
|
[modal]="true"
|
||||||
class="user-dialog"
|
class="user-dialog"
|
||||||
@@ -284,7 +284,7 @@
|
|||||||
<div class="dialog-form">
|
<div class="dialog-form">
|
||||||
<div class="warning-message">
|
<div class="warning-message">
|
||||||
<i class="pi pi-exclamation-triangle"></i>
|
<i class="pi pi-exclamation-triangle"></i>
|
||||||
<p>{{ t('deleteWarning', { count: currentDeleteItem ? 1 : getSelectedItems(currentMergeType).length, type: currentMergeType }) }}</p>
|
<p>{{ t('deleteWarning', { count: currentDeleteItem ? 1 : getSelectedItems(currentMergeType).length, type: getTypeLabel(currentMergeType, true) }) }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@if (currentDeleteItem) {
|
@if (currentDeleteItem) {
|
||||||
@@ -305,7 +305,7 @@
|
|||||||
<div class="delete-info">
|
<div class="delete-info">
|
||||||
<p><strong>{{ t('whatWillHappen') }}</strong></p>
|
<p><strong>{{ t('whatWillHappen') }}</strong></p>
|
||||||
<ul>
|
<ul>
|
||||||
<li>{{ t('deleteItemRemoved', { singular: currentMergeType.slice(0, -1) }) }}</li>
|
<li>{{ t('deleteItemRemoved', { singular: getTypeLabel(currentMergeType, false) }) }}</li>
|
||||||
<li>{{ t('deleteCannotUndo') }}</li>
|
<li>{{ t('deleteCannotUndo') }}</li>
|
||||||
<li>{{ t('totalBooksAffected') }} <strong>{{ currentDeleteItem ? currentDeleteItem.count : getTotalAffectedBooks(getSelectedItems(currentMergeType)) }}</strong></li>
|
<li>{{ t('totalBooksAffected') }} <strong>{{ currentDeleteItem ? currentDeleteItem.count : getTotalAffectedBooks(getSelectedItems(currentMergeType)) }}</strong></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
+19
-12
@@ -33,6 +33,7 @@ type MetadataType = 'authors' | 'categories' | 'moods' | 'tags' | 'series' | 'pu
|
|||||||
interface TabConfig {
|
interface TabConfig {
|
||||||
type: MetadataType;
|
type: MetadataType;
|
||||||
labelKey: string;
|
labelKey: string;
|
||||||
|
labelPluralKey: string;
|
||||||
placeholderKey: string;
|
placeholderKey: string;
|
||||||
selectAllKey: 'selectAllAuthors' | 'selectAllCategories' | 'selectAllMoods' | 'selectAllTags' | 'selectAllSeries' | 'selectAllPublishers' | 'selectAllLanguages';
|
selectAllKey: 'selectAllAuthors' | 'selectAllCategories' | 'selectAllMoods' | 'selectAllTags' | 'selectAllSeries' | 'selectAllPublishers' | 'selectAllLanguages';
|
||||||
icon: string;
|
icon: string;
|
||||||
@@ -125,13 +126,13 @@ export class MetadataManagerComponent implements OnInit, OnDestroy {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tabConfigs: TabConfig[] = [
|
tabConfigs: TabConfig[] = [
|
||||||
{type: 'authors', labelKey: 'tabs.author', placeholderKey: 'placeholders.searchAuthors', selectAllKey: 'selectAllAuthors', icon: 'pi-user'},
|
{type: 'authors', labelKey: 'tabs.author', labelPluralKey: 'tabs.authors', placeholderKey: 'placeholders.searchAuthors', selectAllKey: 'selectAllAuthors', icon: 'pi-user'},
|
||||||
{type: 'categories', labelKey: 'tabs.genre', placeholderKey: 'placeholders.searchGenres', selectAllKey: 'selectAllCategories', icon: 'pi-tag'},
|
{type: 'categories', labelKey: 'tabs.genre', labelPluralKey: 'tabs.genres', placeholderKey: 'placeholders.searchGenres', selectAllKey: 'selectAllCategories', icon: 'pi-tag'},
|
||||||
{type: 'moods', labelKey: 'tabs.mood', placeholderKey: 'placeholders.searchMoods', selectAllKey: 'selectAllMoods', icon: 'pi-heart'},
|
{type: 'moods', labelKey: 'tabs.mood', labelPluralKey: 'tabs.moods', placeholderKey: 'placeholders.searchMoods', selectAllKey: 'selectAllMoods', icon: 'pi-heart'},
|
||||||
{type: 'tags', labelKey: 'tabs.tag', placeholderKey: 'placeholders.searchTags', selectAllKey: 'selectAllTags', icon: 'pi-tags'},
|
{type: 'tags', labelKey: 'tabs.tag', labelPluralKey: 'tabs.tags', placeholderKey: 'placeholders.searchTags', selectAllKey: 'selectAllTags', icon: 'pi-tags'},
|
||||||
{type: 'series', labelKey: 'tabs.series', placeholderKey: 'placeholders.searchSeries', selectAllKey: 'selectAllSeries', icon: 'pi-book'},
|
{type: 'series', labelKey: 'tabs.series', labelPluralKey: 'tabs.seriesPlural', placeholderKey: 'placeholders.searchSeries', selectAllKey: 'selectAllSeries', icon: 'pi-book'},
|
||||||
{type: 'publishers', labelKey: 'tabs.publisher', placeholderKey: 'placeholders.searchPublishers', selectAllKey: 'selectAllPublishers', icon: 'pi-building'},
|
{type: 'publishers', labelKey: 'tabs.publisher', labelPluralKey: 'tabs.publishers', placeholderKey: 'placeholders.searchPublishers', selectAllKey: 'selectAllPublishers', icon: 'pi-building'},
|
||||||
{type: 'languages', labelKey: 'tabs.language', placeholderKey: 'placeholders.searchLanguages', selectAllKey: 'selectAllLanguages', icon: 'pi-globe'}
|
{type: 'languages', labelKey: 'tabs.language', labelPluralKey: 'tabs.languages', placeholderKey: 'placeholders.searchLanguages', selectAllKey: 'selectAllLanguages', icon: 'pi-globe'}
|
||||||
];
|
];
|
||||||
|
|
||||||
ngOnInit() {
|
ngOnInit() {
|
||||||
@@ -303,7 +304,7 @@ export class MetadataManagerComponent implements OnInit, OnDestroy {
|
|||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'warn',
|
severity: 'warn',
|
||||||
summary: this.t.translate('metadata.manager.toast.invalidTargetSummary'),
|
summary: this.t.translate('metadata.manager.toast.invalidTargetSummary'),
|
||||||
detail: this.t.translate('metadata.manager.toast.singleValueOnly', {singular: this.currentMergeType.slice(0, -1)})
|
detail: this.t.translate('metadata.manager.toast.singleValueOnly', {singular: this.getTypeLabel(this.currentMergeType, false)})
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -389,7 +390,7 @@ export class MetadataManagerComponent implements OnInit, OnDestroy {
|
|||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'warn',
|
severity: 'warn',
|
||||||
summary: this.t.translate('metadata.manager.toast.invalidTargetSummary'),
|
summary: this.t.translate('metadata.manager.toast.invalidTargetSummary'),
|
||||||
detail: this.t.translate('metadata.manager.toast.singleMergeValueOnly', {singular: this.currentMergeType.slice(0, -1)})
|
detail: this.t.translate('metadata.manager.toast.singleMergeValueOnly', {singular: this.getTypeLabel(this.currentMergeType, false)})
|
||||||
});
|
});
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -413,8 +414,8 @@ export class MetadataManagerComponent implements OnInit, OnDestroy {
|
|||||||
? this.t.translate('metadata.manager.toast.mergeSuccessfulSummary')
|
? this.t.translate('metadata.manager.toast.mergeSuccessfulSummary')
|
||||||
: this.t.translate('metadata.manager.toast.mergeSplitSuccessfulSummary'),
|
: this.t.translate('metadata.manager.toast.mergeSplitSuccessfulSummary'),
|
||||||
detail: operation === 'merge'
|
detail: operation === 'merge'
|
||||||
? this.t.translate('metadata.manager.toast.mergeSuccessfulDetail', {selectedCount: selected.length, type: this.currentMergeType, targetCount: targetValues.length, bookCount: affectedBooks})
|
? this.t.translate('metadata.manager.toast.mergeSuccessfulDetail', {selectedCount: selected.length, type: this.getTypeLabel(this.currentMergeType, true), targetCount: targetValues.length, bookCount: affectedBooks})
|
||||||
: this.t.translate('metadata.manager.toast.mergeSplitSuccessfulDetail', {selectedCount: selected.length, type: this.currentMergeType, targetCount: targetValues.length, bookCount: affectedBooks}),
|
: this.t.translate('metadata.manager.toast.mergeSplitSuccessfulDetail', {selectedCount: selected.length, type: this.getTypeLabel(this.currentMergeType, true), targetCount: targetValues.length, bookCount: affectedBooks}),
|
||||||
life: 5000
|
life: 5000
|
||||||
});
|
});
|
||||||
this.showMergeDialog = false;
|
this.showMergeDialog = false;
|
||||||
@@ -470,7 +471,7 @@ export class MetadataManagerComponent implements OnInit, OnDestroy {
|
|||||||
this.messageService.add({
|
this.messageService.add({
|
||||||
severity: 'success',
|
severity: 'success',
|
||||||
summary: this.t.translate('metadata.manager.toast.deleteSuccessfulSummary'),
|
summary: this.t.translate('metadata.manager.toast.deleteSuccessfulSummary'),
|
||||||
detail: this.t.translate('metadata.manager.toast.deleteSuccessfulDetail', {count: itemCount, type: this.currentMergeType.slice(0, -1) + (itemCount > 1 ? 's' : ''), bookCount: affectedBooks}),
|
detail: this.t.translate('metadata.manager.toast.deleteSuccessfulDetail', {count: itemCount, type: itemCount > 1 ? this.getTypeLabel(this.currentMergeType, true) : this.getTypeLabel(this.currentMergeType, false), bookCount: affectedBooks}),
|
||||||
life: 5000
|
life: 5000
|
||||||
});
|
});
|
||||||
this.showDeleteDialog = false;
|
this.showDeleteDialog = false;
|
||||||
@@ -611,6 +612,12 @@ export class MetadataManagerComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected getTypeLabel(type: MetadataType, plural: boolean): string {
|
||||||
|
const tab = this.tabConfigs.find(tc => tc.type === type);
|
||||||
|
if (!tab) return type;
|
||||||
|
return this.t.translate('metadata.manager.' + (plural ? tab.labelPluralKey : tab.labelKey));
|
||||||
|
}
|
||||||
|
|
||||||
protected isSingleValueField(type: MetadataType): boolean {
|
protected isSingleValueField(type: MetadataType): boolean {
|
||||||
return type === 'series' || type === 'publishers' || type === 'languages';
|
return type === 'series' || type === 'publishers' || type === 'languages';
|
||||||
}
|
}
|
||||||
|
|||||||
+3
-3
@@ -12,11 +12,11 @@
|
|||||||
|
|
||||||
<div class="section-body">
|
<div class="section-body">
|
||||||
<div class="provider-groups-container">
|
<div class="provider-groups-container">
|
||||||
@for (group of providerGroups; track group.label) {
|
@for (group of providerGroups; track group.labelKey) {
|
||||||
<div class="provider-group">
|
<div class="provider-group">
|
||||||
<div class="group-header">
|
<div class="group-header">
|
||||||
<span class="group-icon pi pi-database"></span>
|
<span class="group-icon pi pi-database"></span>
|
||||||
<h4 class="group-label">{{ group.label }}</h4>
|
<h4 class="group-label">{{ getProviderLabel(group.labelKey) }}</h4>
|
||||||
</div>
|
</div>
|
||||||
<div class="field-list">
|
<div class="field-list">
|
||||||
@for (field of group.fields; track field) {
|
@for (field of group.fields; track field) {
|
||||||
@@ -26,7 +26,7 @@
|
|||||||
[ngModel]="selectedFields.includes(field)"
|
[ngModel]="selectedFields.includes(field)"
|
||||||
(ngModelChange)="toggleField(field, $event)">
|
(ngModelChange)="toggleField(field, $event)">
|
||||||
</p-toggleswitch>
|
</p-toggleswitch>
|
||||||
<label [for]="field">{{ fieldLabels[field] || field }}</label>
|
<label [for]="field">{{ getFieldLabel(field) }}</label>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+18
-55
@@ -4,7 +4,7 @@ import {FormsModule} from '@angular/forms';
|
|||||||
import {AppSettingsService} from '../../../../shared/service/app-settings.service';
|
import {AppSettingsService} from '../../../../shared/service/app-settings.service';
|
||||||
import {AppSettingKey, MetadataProviderSpecificFields} from '../../../../shared/model/app-settings.model';
|
import {AppSettingKey, MetadataProviderSpecificFields} from '../../../../shared/model/app-settings.model';
|
||||||
import {filter, take} from 'rxjs/operators';
|
import {filter, take} from 'rxjs/operators';
|
||||||
import {TranslocoDirective} from '@jsverse/transloco';
|
import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-metadata-provider-field-selector',
|
selector: 'app-metadata-provider-field-selector',
|
||||||
@@ -17,63 +17,26 @@ export class MetadataProviderFieldSelectorComponent implements OnInit {
|
|||||||
@Input() selectedFields: string[] = [];
|
@Input() selectedFields: string[] = [];
|
||||||
|
|
||||||
private appSettingsService = inject(AppSettingsService);
|
private appSettingsService = inject(AppSettingsService);
|
||||||
|
private t = inject(TranslocoService);
|
||||||
|
|
||||||
providerGroups: { label: string, fields: string[] }[] = [
|
providerGroups: { labelKey: string, fields: string[] }[] = [
|
||||||
{
|
{labelKey: 'amazon', fields: ['asin', 'amazonRating', 'amazonReviewCount']},
|
||||||
label: 'Amazon',
|
{labelKey: 'googleBooks', fields: ['googleId']},
|
||||||
fields: ['asin', 'amazonRating', 'amazonReviewCount']
|
{labelKey: 'goodreads', fields: ['goodreadsId', 'goodreadsRating', 'goodreadsReviewCount']},
|
||||||
},
|
{labelKey: 'hardcover', fields: ['hardcoverId', 'hardcoverBookId', 'hardcoverRating', 'hardcoverReviewCount']},
|
||||||
{
|
{labelKey: 'audible', fields: ['audibleId', 'audibleRating', 'audibleReviewCount']},
|
||||||
label: 'Google Books',
|
{labelKey: 'comicvine', fields: ['comicvineId']},
|
||||||
fields: ['googleId']
|
{labelKey: 'lubimyczytac', fields: ['lubimyczytacId', 'lubimyczytacRating']},
|
||||||
},
|
{labelKey: 'ranobedb', fields: ['ranobedbId', 'ranobedbRating']}
|
||||||
{
|
|
||||||
label: 'Goodreads',
|
|
||||||
fields: ['goodreadsId', 'goodreadsRating', 'goodreadsReviewCount']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Hardcover',
|
|
||||||
fields: ['hardcoverId', 'hardcoverBookId', 'hardcoverRating', 'hardcoverReviewCount']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Audible',
|
|
||||||
fields: ['audibleId', 'audibleRating', 'audibleReviewCount']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Comicvine',
|
|
||||||
fields: ['comicvineId']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Lubimyczytac',
|
|
||||||
fields: ['lubimyczytacId', 'lubimyczytacRating']
|
|
||||||
},
|
|
||||||
{
|
|
||||||
label: 'Ranobedb',
|
|
||||||
fields: ['ranobedbId', 'ranobedbRating']
|
|
||||||
}
|
|
||||||
];
|
];
|
||||||
|
|
||||||
fieldLabels: Record<string, string> = {
|
getProviderLabel(key: string): string {
|
||||||
'asin': 'Amazon ASIN',
|
return this.t.translate('settingsMeta.fieldSelector.providers.' + key);
|
||||||
'amazonRating': 'Amazon Rating',
|
}
|
||||||
'amazonReviewCount': 'Amazon Review Count',
|
|
||||||
'googleId': 'Google Books ID',
|
getFieldLabel(field: string): string {
|
||||||
'goodreadsId': 'Goodreads ID',
|
return this.t.translate('settingsMeta.fieldSelector.fields.' + field);
|
||||||
'goodreadsRating': 'Goodreads Rating',
|
}
|
||||||
'goodreadsReviewCount': 'Goodreads Review Count',
|
|
||||||
'hardcoverId': 'Hardcover ID',
|
|
||||||
'hardcoverBookId': 'Hardcover Book ID',
|
|
||||||
'hardcoverRating': 'Hardcover Rating',
|
|
||||||
'hardcoverReviewCount': 'Hardcover Review Count',
|
|
||||||
'comicvineId': 'Comicvine ID',
|
|
||||||
'lubimyczytacId': 'Lubimyczytac ID',
|
|
||||||
'lubimyczytacRating': 'Lubimyczytac Rating',
|
|
||||||
'ranobedbId': 'Ranobedb ID',
|
|
||||||
'ranobedbRating': 'Ranobedb Rating',
|
|
||||||
'audibleId': 'Audible ID',
|
|
||||||
'audibleRating': 'Audible Rating',
|
|
||||||
'audibleReviewCount': 'Audible Review Count',
|
|
||||||
};
|
|
||||||
|
|
||||||
private readonly allFieldNames: (keyof MetadataProviderSpecificFields)[] = [
|
private readonly allFieldNames: (keyof MetadataProviderSpecificFields)[] = [
|
||||||
'asin', 'amazonRating', 'amazonReviewCount',
|
'asin', 'amazonRating', 'amazonReviewCount',
|
||||||
|
|||||||
+1
-1
@@ -38,7 +38,7 @@
|
|||||||
<div class="weights-grid">
|
<div class="weights-grid">
|
||||||
@for (key of orderedKeys; track key) {
|
@for (key of orderedKeys; track key) {
|
||||||
<div class="weight-field">
|
<div class="weight-field">
|
||||||
<label class="field-label">{{ labelMap[key] }}</label>
|
<label class="field-label">{{ getFieldLabel(key) }}</label>
|
||||||
<p-inputNumber
|
<p-inputNumber
|
||||||
size="small"
|
size="small"
|
||||||
[formControlName]="key"
|
[formControlName]="key"
|
||||||
|
|||||||
+13
-29
@@ -23,34 +23,14 @@ import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
|
|||||||
})
|
})
|
||||||
export class MetadataMatchWeightsComponent implements OnInit {
|
export class MetadataMatchWeightsComponent implements OnInit {
|
||||||
|
|
||||||
readonly labelMap: Record<string, string> = {
|
readonly orderedFieldKeys: string[] = [
|
||||||
title: 'Title',
|
'title', 'subtitle', 'authors', 'description', 'publisher', 'publishedDate',
|
||||||
subtitle: 'Subtitle',
|
'categories', 'coverImage', 'seriesName', 'seriesNumber', 'seriesTotal',
|
||||||
authors: 'Authors',
|
'language', 'isbn13', 'isbn10', 'pageCount',
|
||||||
description: 'Description',
|
'amazonRating', 'amazonReviewCount', 'goodreadsRating', 'goodreadsReviewCount',
|
||||||
publisher: 'Publisher',
|
'hardcoverRating', 'hardcoverReviewCount', 'audibleRating', 'audibleReviewCount',
|
||||||
publishedDate: 'Published Date',
|
'doubanRating', 'doubanReviewCount', 'ranobedbRating'
|
||||||
categories: 'Categories',
|
];
|
||||||
coverImage: 'Cover Image',
|
|
||||||
seriesName: 'Series Name',
|
|
||||||
seriesNumber: 'Series Number',
|
|
||||||
seriesTotal: 'Series Total',
|
|
||||||
language: 'Language',
|
|
||||||
isbn13: 'ISBN-13',
|
|
||||||
isbn10: 'ISBN-10',
|
|
||||||
pageCount: 'Page Count',
|
|
||||||
amazonRating: 'Amazon Rating',
|
|
||||||
amazonReviewCount: 'Amazon Rating #',
|
|
||||||
goodreadsRating: 'Goodreads Rating',
|
|
||||||
goodreadsReviewCount: 'Goodreads Rating #',
|
|
||||||
hardcoverRating: 'Hardcover Rating',
|
|
||||||
hardcoverReviewCount: 'Hardcover Rating #',
|
|
||||||
audibleRating: 'Audible Rating',
|
|
||||||
audibleReviewCount: 'Audible Rating #',
|
|
||||||
doubanRating: 'Douban Rating',
|
|
||||||
doubanReviewCount: 'Douban Rating #',
|
|
||||||
ranobedbRating: 'Ranobedb Rating',
|
|
||||||
};
|
|
||||||
|
|
||||||
form!: FormGroup;
|
form!: FormGroup;
|
||||||
isSaving = false;
|
isSaving = false;
|
||||||
@@ -103,7 +83,11 @@ export class MetadataMatchWeightsComponent implements OnInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
get orderedKeys(): string[] {
|
get orderedKeys(): string[] {
|
||||||
return Object.keys(this.labelMap);
|
return this.orderedFieldKeys;
|
||||||
|
}
|
||||||
|
|
||||||
|
getFieldLabel(key: string): string {
|
||||||
|
return this.t.translate('settingsMeta.matchWeights.fields.' + key);
|
||||||
}
|
}
|
||||||
|
|
||||||
save(): void {
|
save(): void {
|
||||||
|
|||||||
+17
-5
@@ -19,13 +19,15 @@ import {TranslocoDirective, TranslocoService} from '@jsverse/transloco';
|
|||||||
})
|
})
|
||||||
export class SidebarSortingPreferencesComponent implements OnInit, OnDestroy {
|
export class SidebarSortingPreferencesComponent implements OnInit, OnDestroy {
|
||||||
|
|
||||||
readonly sortingOptions = [
|
private readonly sortingOptionDefs = [
|
||||||
{label: 'Name | Ascending', value: {field: 'name', order: 'asc'}, translationKey: 'nameAsc'},
|
{value: {field: 'name', order: 'asc'}, translationKey: 'nameAsc'},
|
||||||
{label: 'Name | Descending', value: {field: 'name', order: 'desc'}, translationKey: 'nameDesc'},
|
{value: {field: 'name', order: 'desc'}, translationKey: 'nameDesc'},
|
||||||
{label: 'Creation Date | Ascending', value: {field: 'id', order: 'asc'}, translationKey: 'creationAsc'},
|
{value: {field: 'id', order: 'asc'}, translationKey: 'creationAsc'},
|
||||||
{label: 'Creation Date | Descending', value: {field: 'id', order: 'desc'}, translationKey: 'creationDesc'},
|
{value: {field: 'id', order: 'desc'}, translationKey: 'creationDesc'},
|
||||||
];
|
];
|
||||||
|
|
||||||
|
sortingOptions: {label: string; value: {field: string; order: string}; translationKey: string}[] = [];
|
||||||
|
|
||||||
selectedLibrarySorting: SidebarLibrarySorting = {field: 'id', order: 'asc'};
|
selectedLibrarySorting: SidebarLibrarySorting = {field: 'id', order: 'asc'};
|
||||||
selectedShelfSorting: SidebarShelfSorting = {field: 'id', order: 'asc'};
|
selectedShelfSorting: SidebarShelfSorting = {field: 'id', order: 'asc'};
|
||||||
selectedMagicShelfSorting: SidebarMagicShelfSorting = {field: 'id', order: 'asc'};
|
selectedMagicShelfSorting: SidebarMagicShelfSorting = {field: 'id', order: 'asc'};
|
||||||
@@ -39,6 +41,9 @@ export class SidebarSortingPreferencesComponent implements OnInit, OnDestroy {
|
|||||||
private currentUser: User | null = null;
|
private currentUser: User | null = null;
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.buildSortingOptions();
|
||||||
|
this.t.langChanges$.pipe(takeUntil(this.destroy$)).subscribe(() => this.buildSortingOptions());
|
||||||
|
|
||||||
this.userData$.pipe(
|
this.userData$.pipe(
|
||||||
filter(userState => !!userState?.user && userState.loaded),
|
filter(userState => !!userState?.user && userState.loaded),
|
||||||
takeUntil(this.destroy$)
|
takeUntil(this.destroy$)
|
||||||
@@ -53,6 +58,13 @@ export class SidebarSortingPreferencesComponent implements OnInit, OnDestroy {
|
|||||||
this.destroy$.complete();
|
this.destroy$.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private buildSortingOptions(): void {
|
||||||
|
this.sortingOptions = this.sortingOptionDefs.map(opt => ({
|
||||||
|
...opt,
|
||||||
|
label: this.t.translate('settingsView.sidebarSort.' + opt.translationKey)
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
|
||||||
private loadPreferences(settings: UserSettings): void {
|
private loadPreferences(settings: UserSettings): void {
|
||||||
this.selectedLibrarySorting = settings.sidebarLibrarySorting;
|
this.selectedLibrarySorting = settings.sidebarLibrarySorting;
|
||||||
this.selectedShelfSorting = settings.sidebarShelfSorting;
|
this.selectedShelfSorting = settings.sidebarShelfSorting;
|
||||||
|
|||||||
+64
-38
@@ -44,47 +44,42 @@ import {CdkDrag, CdkDragDrop, CdkDragHandle, CdkDropList, moveItemInArray} from
|
|||||||
export class ViewPreferencesComponent implements OnInit, OnDestroy {
|
export class ViewPreferencesComponent implements OnInit, OnDestroy {
|
||||||
private t = inject(TranslocoService);
|
private t = inject(TranslocoService);
|
||||||
|
|
||||||
sortOptions: {label: string; field: string; translationKey: string}[] = [
|
private readonly sortOptionDefs: {field: string; translationKey: string}[] = [
|
||||||
{label: 'Title', field: 'title', translationKey: 'sortTitle'},
|
{field: 'title', translationKey: 'sortTitle'},
|
||||||
{label: 'File Name', field: 'fileName', translationKey: 'sortFileName'},
|
{field: 'fileName', translationKey: 'sortFileName'},
|
||||||
{label: 'File Path', field: 'filePath', translationKey: 'sortFilePath'},
|
{field: 'filePath', translationKey: 'sortFilePath'},
|
||||||
{label: 'Author', field: 'author', translationKey: 'sortAuthor'},
|
{field: 'author', translationKey: 'sortAuthor'},
|
||||||
{label: 'Author (Surname)', field: 'authorSurnameVorname', translationKey: 'sortAuthorSurname'},
|
{field: 'authorSurnameVorname', translationKey: 'sortAuthorSurname'},
|
||||||
{label: 'Series Name', field: 'seriesName', translationKey: 'sortSeriesName'},
|
{field: 'seriesName', translationKey: 'sortSeriesName'},
|
||||||
{label: 'Series Number', field: 'seriesNumber', translationKey: 'sortSeriesNumber'},
|
{field: 'seriesNumber', translationKey: 'sortSeriesNumber'},
|
||||||
{label: 'Last Read', field: 'lastReadTime', translationKey: 'sortLastRead'},
|
{field: 'lastReadTime', translationKey: 'sortLastRead'},
|
||||||
{label: 'Personal Rating', field: 'personalRating', translationKey: 'sortPersonalRating'},
|
{field: 'personalRating', translationKey: 'sortPersonalRating'},
|
||||||
{label: 'Added On', field: 'addedOn', translationKey: 'sortAddedOn'},
|
{field: 'addedOn', translationKey: 'sortAddedOn'},
|
||||||
{label: 'File Size', field: 'fileSizeKb', translationKey: 'sortFileSize'},
|
{field: 'fileSizeKb', translationKey: 'sortFileSize'},
|
||||||
{label: 'Locked', field: 'locked', translationKey: 'sortLocked'},
|
{field: 'locked', translationKey: 'sortLocked'},
|
||||||
{label: 'Publisher', field: 'publisher', translationKey: 'sortPublisher'},
|
{field: 'publisher', translationKey: 'sortPublisher'},
|
||||||
{label: 'Published Date', field: 'publishedDate', translationKey: 'sortPublishedDate'},
|
{field: 'publishedDate', translationKey: 'sortPublishedDate'},
|
||||||
{label: 'Read Status', field: 'readStatus', translationKey: 'sortReadStatus'},
|
{field: 'readStatus', translationKey: 'sortReadStatus'},
|
||||||
{label: 'Date Finished', field: 'dateFinished', translationKey: 'sortDateFinished'},
|
{field: 'dateFinished', translationKey: 'sortDateFinished'},
|
||||||
{label: 'Reading Progress', field: 'readingProgress', translationKey: 'sortReadingProgress'},
|
{field: 'readingProgress', translationKey: 'sortReadingProgress'},
|
||||||
{label: 'Book Type', field: 'bookType', translationKey: 'sortBookType'},
|
{field: 'bookType', translationKey: 'sortBookType'},
|
||||||
{label: 'Amazon Rating', field: 'amazonRating', translationKey: 'sortAmazonRating'},
|
{field: 'amazonRating', translationKey: 'sortAmazonRating'},
|
||||||
{label: 'Amazon #', field: 'amazonReviewCount', translationKey: 'sortAmazonCount'},
|
{field: 'amazonReviewCount', translationKey: 'sortAmazonCount'},
|
||||||
{label: 'Goodreads Rating', field: 'goodreadsRating', translationKey: 'sortGoodreadsRating'},
|
{field: 'goodreadsRating', translationKey: 'sortGoodreadsRating'},
|
||||||
{label: 'Goodreads #', field: 'goodreadsReviewCount', translationKey: 'sortGoodreadsCount'},
|
{field: 'goodreadsReviewCount', translationKey: 'sortGoodreadsCount'},
|
||||||
{label: 'Hardcover Rating', field: 'hardcoverRating', translationKey: 'sortHardcoverRating'},
|
{field: 'hardcoverRating', translationKey: 'sortHardcoverRating'},
|
||||||
{label: 'Hardcover #', field: 'hardcoverReviewCount', translationKey: 'sortHardcoverCount'},
|
{field: 'hardcoverReviewCount', translationKey: 'sortHardcoverCount'},
|
||||||
{label: 'Ranobedb Rating', field: 'ranobedbRating', translationKey: 'sortRanobedbRating'},
|
{field: 'ranobedbRating', translationKey: 'sortRanobedbRating'},
|
||||||
{label: 'Narrator', field: 'narrator', translationKey: 'sortNarrator'},
|
{field: 'narrator', translationKey: 'sortNarrator'},
|
||||||
{label: 'Pages', field: 'pageCount', translationKey: 'sortPages'},
|
{field: 'pageCount', translationKey: 'sortPages'},
|
||||||
{label: 'Random', field: 'random', translationKey: 'sortRandom'},
|
{field: 'random', translationKey: 'sortRandom'},
|
||||||
];
|
];
|
||||||
|
|
||||||
entityTypeOptions: {label: string; value: string; translationKey: string}[] = [
|
sortOptions: {label: string; field: string; translationKey: string}[] = [];
|
||||||
{label: 'Library', value: 'LIBRARY', translationKey: 'entityLibrary'},
|
|
||||||
{label: 'Shelf', value: 'SHELF', translationKey: 'entityShelf'},
|
|
||||||
{label: 'Magic Shelf', value: 'MAGIC_SHELF', translationKey: 'entityMagicShelf'}
|
|
||||||
];
|
|
||||||
|
|
||||||
viewModeOptions: {label: string; value: string; translationKey: string}[] = [
|
entityTypeOptions: {label: string; value: string; translationKey: string}[] = [];
|
||||||
{label: 'Grid', value: 'GRID', translationKey: 'viewGrid'},
|
|
||||||
{label: 'Table', value: 'TABLE', translationKey: 'viewTable'}
|
viewModeOptions: {label: string; value: string; translationKey: string}[] = [];
|
||||||
];
|
|
||||||
|
|
||||||
libraryOptions: { label: string; value: number }[] = [];
|
libraryOptions: { label: string; value: number }[] = [];
|
||||||
shelfOptions: { label: string; value: number }[] = [];
|
shelfOptions: { label: string; value: number }[] = [];
|
||||||
@@ -128,6 +123,20 @@ export class ViewPreferencesComponent implements OnInit, OnDestroy {
|
|||||||
private messageService = inject(MessageService);
|
private messageService = inject(MessageService);
|
||||||
|
|
||||||
ngOnInit(): void {
|
ngOnInit(): void {
|
||||||
|
this.rebuildTranslatedLabels();
|
||||||
|
this.t.langChanges$.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
||||||
|
this.rebuildTranslatedLabels();
|
||||||
|
this.allSortAsOptions = this.sortOptions.map(o => ({
|
||||||
|
label: this.t.translate('settingsView.librarySort.' + o.translationKey),
|
||||||
|
field: o.field,
|
||||||
|
direction: SortDirection.ASCENDING
|
||||||
|
}));
|
||||||
|
this.globalSortAsOptions = this.toSortOptions(this.sortCriteria);
|
||||||
|
this.overrides.forEach(o => {
|
||||||
|
o.sortCriteriaAsOptions = this.toSortOptions(o.sortCriteria);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
combineLatest([
|
combineLatest([
|
||||||
this.userService.userState$.pipe(filter(userState => !!userState?.user && userState.loaded), take(1)),
|
this.userService.userState$.pipe(filter(userState => !!userState?.user && userState.loaded), take(1)),
|
||||||
this.libraryService.libraryState$.pipe(filter(libraryState => !!libraryState?.libraries && libraryState.loaded), take(1)),
|
this.libraryService.libraryState$.pipe(filter(libraryState => !!libraryState?.libraries && libraryState.loaded), take(1)),
|
||||||
@@ -196,6 +205,23 @@ export class ViewPreferencesComponent implements OnInit, OnDestroy {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private rebuildTranslatedLabels(): void {
|
||||||
|
this.sortOptions = this.sortOptionDefs.map(o => ({
|
||||||
|
label: this.t.translate('settingsView.librarySort.' + o.translationKey),
|
||||||
|
field: o.field,
|
||||||
|
translationKey: o.translationKey
|
||||||
|
}));
|
||||||
|
this.entityTypeOptions = [
|
||||||
|
{label: this.t.translate('settingsView.librarySort.entityLibrary'), value: 'LIBRARY', translationKey: 'entityLibrary'},
|
||||||
|
{label: this.t.translate('settingsView.librarySort.entityShelf'), value: 'SHELF', translationKey: 'entityShelf'},
|
||||||
|
{label: this.t.translate('settingsView.librarySort.entityMagicShelf'), value: 'MAGIC_SHELF', translationKey: 'entityMagicShelf'}
|
||||||
|
];
|
||||||
|
this.viewModeOptions = [
|
||||||
|
{label: this.t.translate('settingsView.librarySort.viewGrid'), value: 'GRID', translationKey: 'viewGrid'},
|
||||||
|
{label: this.t.translate('settingsView.librarySort.viewTable'), value: 'TABLE', translationKey: 'viewTable'}
|
||||||
|
];
|
||||||
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
this.destroy$.next();
|
this.destroy$.next();
|
||||||
this.destroy$.complete();
|
this.destroy$.complete();
|
||||||
|
|||||||
+12
-10
@@ -1,11 +1,12 @@
|
|||||||
|
<ng-container *transloco="let t; prefix: 'shared.supportDialog'">
|
||||||
<div class="support-dialog-container">
|
<div class="support-dialog-container">
|
||||||
<div class="panel-header">
|
<div class="panel-header">
|
||||||
<div class="header-icon-wrapper">
|
<div class="header-icon-wrapper">
|
||||||
<i class="pi pi-heart header-icon"></i>
|
<i class="pi pi-heart header-icon"></i>
|
||||||
</div>
|
</div>
|
||||||
<div class="header-text">
|
<div class="header-text">
|
||||||
<h2 class="panel-title">Support BookLore</h2>
|
<h2 class="panel-title">{{ t('title') }}</h2>
|
||||||
<p class="panel-description">From a solo dev who loves books</p>
|
<p class="panel-description">{{ t('subtitle') }}</p>
|
||||||
</div>
|
</div>
|
||||||
<p-button
|
<p-button
|
||||||
icon="pi pi-times"
|
icon="pi pi-times"
|
||||||
@@ -19,15 +20,15 @@
|
|||||||
|
|
||||||
<div class="dialog-content">
|
<div class="dialog-content">
|
||||||
<p class="intro">
|
<p class="intro">
|
||||||
BookLore is built and maintained by a single developer who genuinely loves books. If it's made organizing your library a little more enjoyable, here are a few ways to support the project and keep it going.
|
{{ t('intro') }}
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
<div class="support-cards">
|
<div class="support-cards">
|
||||||
<a class="support-card star-card" href="https://github.com/booklore-app/booklore" target="_blank" rel="noopener noreferrer">
|
<a class="support-card star-card" href="https://github.com/booklore-app/booklore" target="_blank" rel="noopener noreferrer">
|
||||||
<i class="pi pi-github card-icon"></i>
|
<i class="pi pi-github card-icon"></i>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
<span class="card-title">Star on GitHub</span>
|
<span class="card-title">{{ t('starTitle') }}</span>
|
||||||
<span class="card-desc">A star goes a long way. It helps new people find BookLore and keeps me motivated.</span>
|
<span class="card-desc">{{ t('starDesc') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<i class="pi pi-arrow-up-right card-arrow"></i>
|
<i class="pi pi-arrow-up-right card-arrow"></i>
|
||||||
</a>
|
</a>
|
||||||
@@ -35,8 +36,8 @@
|
|||||||
<a class="support-card collective-card" href="https://opencollective.com/booklore" target="_blank" rel="noopener noreferrer">
|
<a class="support-card collective-card" href="https://opencollective.com/booklore" target="_blank" rel="noopener noreferrer">
|
||||||
<i class="pi pi-heart card-icon"></i>
|
<i class="pi pi-heart card-icon"></i>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
<span class="card-title">Open Collective</span>
|
<span class="card-title">{{ t('collectiveTitle') }}</span>
|
||||||
<span class="card-desc">Recurring support that helps cover hosting and keeps development sustainable.</span>
|
<span class="card-desc">{{ t('collectiveDesc') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<i class="pi pi-arrow-up-right card-arrow"></i>
|
<i class="pi pi-arrow-up-right card-arrow"></i>
|
||||||
</a>
|
</a>
|
||||||
@@ -44,13 +45,14 @@
|
|||||||
<a class="support-card kofi-card" href="https://ko-fi.com/bookloredev" target="_blank" rel="noopener noreferrer">
|
<a class="support-card kofi-card" href="https://ko-fi.com/bookloredev" target="_blank" rel="noopener noreferrer">
|
||||||
<i class="pi pi-gift card-icon"></i>
|
<i class="pi pi-gift card-icon"></i>
|
||||||
<div class="card-text">
|
<div class="card-text">
|
||||||
<span class="card-title">Buy me a coffee</span>
|
<span class="card-title">{{ t('kofiTitle') }}</span>
|
||||||
<span class="card-desc">A one-time tip to fuel late-night coding sessions. Every bit is appreciated!</span>
|
<span class="card-desc">{{ t('kofiDesc') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<i class="pi pi-arrow-up-right card-arrow"></i>
|
<i class="pi pi-arrow-up-right card-arrow"></i>
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p class="closing">Thank you for being part of the BookLore community.</p>
|
<p class="closing">{{ t('closing') }}</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
</ng-container>
|
||||||
|
|||||||
+3
-1
@@ -1,11 +1,13 @@
|
|||||||
import {Component, inject} from '@angular/core';
|
import {Component, inject} from '@angular/core';
|
||||||
import {Button} from 'primeng/button';
|
import {Button} from 'primeng/button';
|
||||||
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
import {DynamicDialogRef} from 'primeng/dynamicdialog';
|
||||||
|
import {TranslocoDirective} from '@jsverse/transloco';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'app-github-support-dialog',
|
selector: 'app-github-support-dialog',
|
||||||
imports: [
|
imports: [
|
||||||
Button
|
Button,
|
||||||
|
TranslocoDirective
|
||||||
],
|
],
|
||||||
templateUrl: './github-support-dialog.html',
|
templateUrl: './github-support-dialog.html',
|
||||||
styleUrls: ['./github-support-dialog.scss']
|
styleUrls: ['./github-support-dialog.scss']
|
||||||
|
|||||||
+18
-3
@@ -1,8 +1,10 @@
|
|||||||
import {Component, inject} from '@angular/core';
|
import {Component, inject, OnDestroy} from '@angular/core';
|
||||||
import {NotificationEventService} from '../../websocket/notification-event.service';
|
import {NotificationEventService} from '../../websocket/notification-event.service';
|
||||||
import {LogNotification} from '../../websocket/model/log-notification.model';
|
import {LogNotification} from '../../websocket/model/log-notification.model';
|
||||||
import {Tag} from 'primeng/tag';
|
import {Tag} from 'primeng/tag';
|
||||||
import {TranslocoService} from '@jsverse/transloco';
|
import {TranslocoService} from '@jsverse/transloco';
|
||||||
|
import {Subject} from 'rxjs';
|
||||||
|
import {takeUntil} from 'rxjs/operators';
|
||||||
|
|
||||||
import {TagComponent} from '../tag/tag.component';
|
import {TagComponent} from '../tag/tag.component';
|
||||||
|
|
||||||
@@ -18,16 +20,29 @@ import {TagComponent} from '../tag/tag.component';
|
|||||||
TagComponent
|
TagComponent
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
export class LiveNotificationBoxComponent {
|
export class LiveNotificationBoxComponent implements OnDestroy {
|
||||||
private readonly t = inject(TranslocoService);
|
private readonly t = inject(TranslocoService);
|
||||||
|
private readonly destroy$ = new Subject<void>();
|
||||||
latestNotification: LogNotification = {message: this.t.translate('shared.liveNotification.defaultMessage')};
|
latestNotification: LogNotification = {message: this.t.translate('shared.liveNotification.defaultMessage')};
|
||||||
|
private hasReceivedNotification = false;
|
||||||
|
|
||||||
private notificationService = inject(NotificationEventService);
|
private notificationService = inject(NotificationEventService);
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
this.notificationService.latestNotification$.subscribe(notification => {
|
this.notificationService.latestNotification$.pipe(takeUntil(this.destroy$)).subscribe(notification => {
|
||||||
|
this.hasReceivedNotification = true;
|
||||||
this.latestNotification = notification;
|
this.latestNotification = notification;
|
||||||
});
|
});
|
||||||
|
this.t.langChanges$.pipe(takeUntil(this.destroy$)).subscribe(() => {
|
||||||
|
if (!this.hasReceivedNotification) {
|
||||||
|
this.latestNotification = {message: this.t.translate('shared.liveNotification.defaultMessage')};
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
ngOnDestroy(): void {
|
||||||
|
this.destroy$.next();
|
||||||
|
this.destroy$.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
getSeverityColor(severity?: string): 'red' | 'amber' | 'green' | 'gray' {
|
getSeverityColor(severity?: string): 'red' | 'amber' | 'green' | 'gray' {
|
||||||
|
|||||||
@@ -132,6 +132,12 @@ export class AppTopBarComponent implements OnDestroy {
|
|||||||
.subscribe(() => {
|
.subscribe(() => {
|
||||||
this.initializeStatsMenu();
|
this.initializeStatsMenu();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
this.translocoService.langChanges$
|
||||||
|
.pipe(takeUntil(this.destroy$))
|
||||||
|
.subscribe(() => {
|
||||||
|
this.initializeStatsMenu();
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnDestroy(): void {
|
ngOnDestroy(): void {
|
||||||
|
|||||||
@@ -498,12 +498,19 @@
|
|||||||
"deleting": "Deleting...",
|
"deleting": "Deleting...",
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"author": "Author",
|
"author": "Author",
|
||||||
|
"authors": "Authors",
|
||||||
"genre": "Genre",
|
"genre": "Genre",
|
||||||
|
"genres": "Genres",
|
||||||
"mood": "Mood",
|
"mood": "Mood",
|
||||||
|
"moods": "Moods",
|
||||||
"tag": "Tag",
|
"tag": "Tag",
|
||||||
|
"tags": "Tags",
|
||||||
"series": "Series",
|
"series": "Series",
|
||||||
|
"seriesPlural": "Series",
|
||||||
"publisher": "Publisher",
|
"publisher": "Publisher",
|
||||||
"language": "Language"
|
"publishers": "Publishers",
|
||||||
|
"language": "Language",
|
||||||
|
"languages": "Languages"
|
||||||
},
|
},
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"searchAuthors": "Search authors...",
|
"searchAuthors": "Search authors...",
|
||||||
|
|||||||
@@ -63,10 +63,6 @@
|
|||||||
"hardcoverPlaceholder": "Enter Hardcover API token",
|
"hardcoverPlaceholder": "Enter Hardcover API token",
|
||||||
"comicvinePlaceholder": "Enter Comic Vine API token"
|
"comicvinePlaceholder": "Enter Comic Vine API token"
|
||||||
},
|
},
|
||||||
"fieldSelector": {
|
|
||||||
"sectionTitle": "Enabled Fields in Metadata Editor & Picker",
|
|
||||||
"sectionDesc": "Select which metadata fields to display when editing book information or picking metadata from providers. Disabled fields will be hidden from the interface."
|
|
||||||
},
|
|
||||||
"publicReviews": {
|
"publicReviews": {
|
||||||
"sectionTitle": "Public Reviews",
|
"sectionTitle": "Public Reviews",
|
||||||
"sectionDesc": "Configure automatic downloading of user reviews from external platforms. Reviews can be fetched from Amazon, Goodreads, and Hardcover for offline access.",
|
"sectionDesc": "Configure automatic downloading of user reviews from external platforms. Reviews can be fetched from Amazon, Goodreads, and Hardcover for offline access.",
|
||||||
@@ -91,6 +87,69 @@
|
|||||||
"saveSuccess": "Weights saved successfully",
|
"saveSuccess": "Weights saved successfully",
|
||||||
"saveError": "Failed to save weights",
|
"saveError": "Failed to save weights",
|
||||||
"recalcSuccess": "All book match scores were recalculated successfully.",
|
"recalcSuccess": "All book match scores were recalculated successfully.",
|
||||||
"recalcError": "Failed to recalculate match scores."
|
"recalcError": "Failed to recalculate match scores.",
|
||||||
|
"fields": {
|
||||||
|
"title": "Title",
|
||||||
|
"subtitle": "Subtitle",
|
||||||
|
"authors": "Authors",
|
||||||
|
"description": "Description",
|
||||||
|
"publisher": "Publisher",
|
||||||
|
"publishedDate": "Published Date",
|
||||||
|
"categories": "Categories",
|
||||||
|
"coverImage": "Cover Image",
|
||||||
|
"seriesName": "Series Name",
|
||||||
|
"seriesNumber": "Series Number",
|
||||||
|
"seriesTotal": "Series Total",
|
||||||
|
"language": "Language",
|
||||||
|
"isbn13": "ISBN-13",
|
||||||
|
"isbn10": "ISBN-10",
|
||||||
|
"pageCount": "Page Count",
|
||||||
|
"amazonRating": "Amazon Rating",
|
||||||
|
"amazonReviewCount": "Amazon Rating #",
|
||||||
|
"goodreadsRating": "Goodreads Rating",
|
||||||
|
"goodreadsReviewCount": "Goodreads Rating #",
|
||||||
|
"hardcoverRating": "Hardcover Rating",
|
||||||
|
"hardcoverReviewCount": "Hardcover Rating #",
|
||||||
|
"audibleRating": "Audible Rating",
|
||||||
|
"audibleReviewCount": "Audible Rating #",
|
||||||
|
"doubanRating": "Douban Rating",
|
||||||
|
"doubanReviewCount": "Douban Rating #",
|
||||||
|
"ranobedbRating": "Ranobedb Rating"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"fieldSelector": {
|
||||||
|
"sectionTitle": "Enabled Fields in Metadata Editor & Picker",
|
||||||
|
"sectionDesc": "Select which metadata fields to display when editing book information or picking metadata from providers. Disabled fields will be hidden from the interface.",
|
||||||
|
"providers": {
|
||||||
|
"amazon": "Amazon",
|
||||||
|
"googleBooks": "Google Books",
|
||||||
|
"goodreads": "Goodreads",
|
||||||
|
"hardcover": "Hardcover",
|
||||||
|
"audible": "Audible",
|
||||||
|
"comicvine": "Comicvine",
|
||||||
|
"lubimyczytac": "Lubimyczytac",
|
||||||
|
"ranobedb": "Ranobedb"
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"asin": "Amazon ASIN",
|
||||||
|
"amazonRating": "Amazon Rating",
|
||||||
|
"amazonReviewCount": "Amazon Review Count",
|
||||||
|
"googleId": "Google Books ID",
|
||||||
|
"goodreadsId": "Goodreads ID",
|
||||||
|
"goodreadsRating": "Goodreads Rating",
|
||||||
|
"goodreadsReviewCount": "Goodreads Review Count",
|
||||||
|
"hardcoverId": "Hardcover ID",
|
||||||
|
"hardcoverBookId": "Hardcover Book ID",
|
||||||
|
"hardcoverRating": "Hardcover Rating",
|
||||||
|
"hardcoverReviewCount": "Hardcover Review Count",
|
||||||
|
"comicvineId": "Comicvine ID",
|
||||||
|
"lubimyczytacId": "Lubimyczytac ID",
|
||||||
|
"lubimyczytacRating": "Lubimyczytac Rating",
|
||||||
|
"ranobedbId": "Ranobedb ID",
|
||||||
|
"ranobedbRating": "Ranobedb Rating",
|
||||||
|
"audibleId": "Audible ID",
|
||||||
|
"audibleRating": "Audible Rating",
|
||||||
|
"audibleReviewCount": "Audible Review Count"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,18 @@
|
|||||||
"liveNotification": {
|
"liveNotification": {
|
||||||
"defaultMessage": "No recent notifications..."
|
"defaultMessage": "No recent notifications..."
|
||||||
},
|
},
|
||||||
|
"supportDialog": {
|
||||||
|
"title": "Support BookLore",
|
||||||
|
"subtitle": "From a solo dev who loves books",
|
||||||
|
"intro": "BookLore is built and maintained by a single developer who genuinely loves books. If it's made organizing your library a little more enjoyable, here are a few ways to support the project and keep it going.",
|
||||||
|
"starTitle": "Star on GitHub",
|
||||||
|
"starDesc": "A star goes a long way. It helps new people find BookLore and keeps me motivated.",
|
||||||
|
"collectiveTitle": "Open Collective",
|
||||||
|
"collectiveDesc": "Recurring support that helps cover hosting and keeps development sustainable.",
|
||||||
|
"kofiTitle": "Buy me a coffee",
|
||||||
|
"kofiDesc": "A one-time tip to fuel late-night coding sessions. Every bit is appreciated!",
|
||||||
|
"closing": "Thank you for being part of the BookLore community."
|
||||||
|
},
|
||||||
"metadataProgress": {
|
"metadataProgress": {
|
||||||
"taskStalled": "Task stalled or backend unavailable",
|
"taskStalled": "Task stalled or backend unavailable",
|
||||||
"taskCancelled": "Task cancelled by user",
|
"taskCancelled": "Task cancelled by user",
|
||||||
|
|||||||
@@ -498,12 +498,19 @@
|
|||||||
"deleting": "Eliminando...",
|
"deleting": "Eliminando...",
|
||||||
"tabs": {
|
"tabs": {
|
||||||
"author": "Autor",
|
"author": "Autor",
|
||||||
|
"authors": "Autores",
|
||||||
"genre": "Género",
|
"genre": "Género",
|
||||||
|
"genres": "Géneros",
|
||||||
"mood": "Estado de ánimo",
|
"mood": "Estado de ánimo",
|
||||||
|
"moods": "Estados de ánimo",
|
||||||
"tag": "Etiqueta",
|
"tag": "Etiqueta",
|
||||||
|
"tags": "Etiquetas",
|
||||||
"series": "Serie",
|
"series": "Serie",
|
||||||
|
"seriesPlural": "Series",
|
||||||
"publisher": "Editorial",
|
"publisher": "Editorial",
|
||||||
"language": "Idioma"
|
"publishers": "Editoriales",
|
||||||
|
"language": "Idioma",
|
||||||
|
"languages": "Idiomas"
|
||||||
},
|
},
|
||||||
"placeholders": {
|
"placeholders": {
|
||||||
"searchAuthors": "Buscar autores...",
|
"searchAuthors": "Buscar autores...",
|
||||||
|
|||||||
@@ -65,7 +65,38 @@
|
|||||||
},
|
},
|
||||||
"fieldSelector": {
|
"fieldSelector": {
|
||||||
"sectionTitle": "Campos habilitados en el editor y selector de metadatos",
|
"sectionTitle": "Campos habilitados en el editor y selector de metadatos",
|
||||||
"sectionDesc": "Selecciona qué campos de metadatos mostrar al editar información del libro o seleccionar metadatos de proveedores. Los campos deshabilitados se ocultarán de la interfaz."
|
"sectionDesc": "Selecciona qué campos de metadatos mostrar al editar información del libro o seleccionar metadatos de proveedores. Los campos deshabilitados se ocultarán de la interfaz.",
|
||||||
|
"providers": {
|
||||||
|
"amazon": "Amazon",
|
||||||
|
"googleBooks": "Google Books",
|
||||||
|
"goodreads": "Goodreads",
|
||||||
|
"hardcover": "Hardcover",
|
||||||
|
"audible": "Audible",
|
||||||
|
"comicvine": "Comicvine",
|
||||||
|
"lubimyczytac": "Lubimyczytac",
|
||||||
|
"ranobedb": "Ranobedb"
|
||||||
|
},
|
||||||
|
"fields": {
|
||||||
|
"asin": "Amazon ASIN",
|
||||||
|
"amazonRating": "Valoración de Amazon",
|
||||||
|
"amazonReviewCount": "Reseñas de Amazon",
|
||||||
|
"googleId": "ID de Google Books",
|
||||||
|
"goodreadsId": "ID de Goodreads",
|
||||||
|
"goodreadsRating": "Valoración de Goodreads",
|
||||||
|
"goodreadsReviewCount": "Reseñas de Goodreads",
|
||||||
|
"hardcoverId": "ID de Hardcover",
|
||||||
|
"hardcoverBookId": "ID de libro Hardcover",
|
||||||
|
"hardcoverRating": "Valoración de Hardcover",
|
||||||
|
"hardcoverReviewCount": "Reseñas de Hardcover",
|
||||||
|
"comicvineId": "ID de Comicvine",
|
||||||
|
"lubimyczytacId": "ID de Lubimyczytac",
|
||||||
|
"lubimyczytacRating": "Valoración de Lubimyczytac",
|
||||||
|
"ranobedbId": "ID de Ranobedb",
|
||||||
|
"ranobedbRating": "Valoración de Ranobedb",
|
||||||
|
"audibleId": "ID de Audible",
|
||||||
|
"audibleRating": "Valoración de Audible",
|
||||||
|
"audibleReviewCount": "Reseñas de Audible"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"publicReviews": {
|
"publicReviews": {
|
||||||
"sectionTitle": "Reseñas públicas",
|
"sectionTitle": "Reseñas públicas",
|
||||||
@@ -91,6 +122,34 @@
|
|||||||
"saveSuccess": "Pesos guardados correctamente",
|
"saveSuccess": "Pesos guardados correctamente",
|
||||||
"saveError": "Error al guardar los pesos",
|
"saveError": "Error al guardar los pesos",
|
||||||
"recalcSuccess": "Todas las puntuaciones de coincidencia de libros se recalcularon correctamente.",
|
"recalcSuccess": "Todas las puntuaciones de coincidencia de libros se recalcularon correctamente.",
|
||||||
"recalcError": "Error al recalcular las puntuaciones de coincidencia."
|
"recalcError": "Error al recalcular las puntuaciones de coincidencia.",
|
||||||
|
"fields": {
|
||||||
|
"title": "Título",
|
||||||
|
"subtitle": "Subtítulo",
|
||||||
|
"authors": "Autores",
|
||||||
|
"description": "Descripción",
|
||||||
|
"publisher": "Editorial",
|
||||||
|
"publishedDate": "Fecha de publicación",
|
||||||
|
"categories": "Categorías",
|
||||||
|
"coverImage": "Imagen de portada",
|
||||||
|
"seriesName": "Nombre de serie",
|
||||||
|
"seriesNumber": "Número de serie",
|
||||||
|
"seriesTotal": "Total de serie",
|
||||||
|
"language": "Idioma",
|
||||||
|
"isbn13": "ISBN-13",
|
||||||
|
"isbn10": "ISBN-10",
|
||||||
|
"pageCount": "Número de páginas",
|
||||||
|
"amazonRating": "Valoración de Amazon",
|
||||||
|
"amazonReviewCount": "Valoración de Amazon #",
|
||||||
|
"goodreadsRating": "Valoración de Goodreads",
|
||||||
|
"goodreadsReviewCount": "Valoración de Goodreads #",
|
||||||
|
"hardcoverRating": "Valoración de Hardcover",
|
||||||
|
"hardcoverReviewCount": "Valoración de Hardcover #",
|
||||||
|
"audibleRating": "Valoración de Audible",
|
||||||
|
"audibleReviewCount": "Valoración de Audible #",
|
||||||
|
"doubanRating": "Valoración de Douban",
|
||||||
|
"doubanReviewCount": "Valoración de Douban #",
|
||||||
|
"ranobedbRating": "Valoración de Ranobedb"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,6 +92,18 @@
|
|||||||
"liveNotification": {
|
"liveNotification": {
|
||||||
"defaultMessage": "Sin notificaciones recientes..."
|
"defaultMessage": "Sin notificaciones recientes..."
|
||||||
},
|
},
|
||||||
|
"supportDialog": {
|
||||||
|
"title": "Apoyar BookLore",
|
||||||
|
"subtitle": "De un desarrollador independiente que ama los libros",
|
||||||
|
"intro": "BookLore es creado y mantenido por un solo desarrollador que realmente ama los libros. Si ha hecho que organizar tu biblioteca sea un poco más agradable, aquí tienes algunas formas de apoyar el proyecto y mantenerlo en marcha.",
|
||||||
|
"starTitle": "Estrella en GitHub",
|
||||||
|
"starDesc": "Una estrella ayuda mucho. Permite que nuevas personas descubran BookLore y me mantiene motivado.",
|
||||||
|
"collectiveTitle": "Open Collective",
|
||||||
|
"collectiveDesc": "Apoyo recurrente que ayuda a cubrir el alojamiento y mantener el desarrollo sostenible.",
|
||||||
|
"kofiTitle": "Invítame un café",
|
||||||
|
"kofiDesc": "Una propina para las sesiones de programación nocturnas. ¡Cada aporte se agradece!",
|
||||||
|
"closing": "Gracias por ser parte de la comunidad de BookLore."
|
||||||
|
},
|
||||||
"metadataProgress": {
|
"metadataProgress": {
|
||||||
"taskStalled": "Tarea detenida o servidor no disponible",
|
"taskStalled": "Tarea detenida o servidor no disponible",
|
||||||
"taskCancelled": "Tarea cancelada por el usuario",
|
"taskCancelled": "Tarea cancelada por el usuario",
|
||||||
|
|||||||
Reference in New Issue
Block a user