Rating Overhaul (#2159)

* Switched Ratings to a float system. Allow rating something as 0%. Allow half step ratings. Added new css variable: --rating-star-color. By default, N/A will show for series that have no ratings. N/A ratings are not included in overall rating calculations.

* Show extended entity properties on desktop for list view cards.

* Refactored the code for series metadata detail to use a re-usable component to reduce the copy/paste for the Genres tags like sections.

* List Item will show extended properties about a chapter/volume, like weblinks on Desktop viewports.

* Refactored even further so all of series detail uses the same component code. Tweaked the spacing on the series detail area.

List items will now show Characters and Tags which are helpful for more Hentai related content.

* Fixed a bug with removing something from "OnDeckRemoval" table when something was read.
This commit is contained in:
Joe Milazzo 2023-07-25 11:57:07 -05:00 committed by GitHub
parent f5ad821cd9
commit 734e299f7f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
29 changed files with 2760 additions and 405 deletions

View file

@ -34,7 +34,11 @@ export enum FilterQueryParam {
/**
* This is a pagination control
*/
Page = 'page'
Page = 'page',
/**
* Special case for the UI. Does not trigger filtering
*/
None = 'none'
}
@Injectable({
@ -46,19 +50,19 @@ export class FilterUtilitiesService {
/**
* Updates the window location with a custom url based on filter and pagination objects
* @param pagination
* @param filter
* @param pagination
* @param filter
*/
updateUrlFromFilter(pagination: Pagination, filter: SeriesFilter | undefined) {
const params = '?page=' + pagination.currentPage;
const url = this.urlFromFilter(window.location.href.split('?')[0] + params, filter);
window.history.replaceState(window.location.href, '', this.replacePaginationOnUrl(url, pagination));
}
/**
* Patches the page query param in the window location.
* @param pagination
* Patches the page query param in the window location.
* @param pagination
*/
updateUrlFromPagination(pagination: Pagination) {
window.history.replaceState(window.location.href, '', this.replacePaginationOnUrl(window.location.href, pagination));
@ -127,7 +131,7 @@ export class FilterUtilitiesService {
if (filter.seriesNameQuery !== '') {
params += `&${FilterQueryParam.Name}=${encodeURIComponent(filter.seriesNameQuery)}`;
}
return currentUrl + params;
}
@ -262,7 +266,7 @@ export class FilterUtilitiesService {
anyChanged = true;
}
// Rating, seriesName,
// Rating, seriesName,
const rating = snapshot.queryParamMap.get(FilterQueryParam.Rating);
if (rating !== undefined && rating !== null && parseInt(rating, 10) > 0) {
filter.rating = parseInt(rating, 10);
@ -301,7 +305,7 @@ export class FilterUtilitiesService {
filter.seriesNameQuery = decodeURIComponent(searchNameQuery);
anyChanged = true;
}
return [filter, false]; // anyChanged. Testing out if having a filter active but keep drawer closed by default works better
}