Per user personal ratings (#1820)
* Change personal ratings to be saved per user * Only copy ratings to users with existing progress records
This commit is contained in:
@@ -531,6 +531,22 @@ export class BookService {
|
||||
);
|
||||
}
|
||||
|
||||
resetPersonalRating(bookIds: number | number[]): Observable<Book[]> {
|
||||
const ids = Array.isArray(bookIds) ? bookIds : [bookIds];
|
||||
return this.http.post<Book[]>(`${this.url}/reset-personal-rating`, ids).pipe(
|
||||
tap(updatedBooks => updatedBooks.forEach(book => this.handleBookUpdate(book)))
|
||||
);
|
||||
}
|
||||
|
||||
updatePersonalRating(bookIds: number | number[], rating: number): Observable<Book[]> {
|
||||
const ids = Array.isArray(bookIds) ? bookIds : [bookIds];
|
||||
return this.http.put<Book[]>(`${this.url}/personal-rating`, {ids, rating}).pipe(
|
||||
tap(updatedBooks => {
|
||||
updatedBooks.forEach(updatedBook => this.handleBookUpdate(updatedBook));
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
consolidateMetadata(metadataType: 'authors' | 'categories' | 'moods' | 'tags' | 'series' | 'publishers' | 'languages', targetValues: string[], valuesToMerge: string[]): Observable<any> {
|
||||
const payload = {metadataType, targetValues, valuesToMerge};
|
||||
return this.http.post(`${this.url}/metadata/manage/consolidate`, payload).pipe(
|
||||
|
||||
@@ -79,7 +79,7 @@ export class SortService {
|
||||
publisher: (book) => book.metadata?.publisher || null,
|
||||
pageCount: (book) => book.metadata?.pageCount || null,
|
||||
rating: (book) => book.metadata?.rating || null,
|
||||
personalRating: (book) => book.metadata?.personalRating || null,
|
||||
personalRating: (book) => book.personalRating || null,
|
||||
reviewCount: (book) => book.metadata?.reviewCount || null,
|
||||
amazonRating: (book) => book.metadata?.amazonRating || null,
|
||||
amazonReviewCount: (book) => book.metadata?.amazonReviewCount || null,
|
||||
|
||||
Reference in New Issue
Block a user