fix(library): keep album group image size local

The album group size input bumped general.imageRes.table whenever
the entered size was >= the current table resolution, silently
rewriting a global setting that affects every table.
This commit is contained in:
jeffvli committed 2026-09-28 21:55:01 -07:00
1 parent b8e2045568
commit 04532cceae
3 files changed
+7 -12

No files matched your search

@@ -43,12 +43,14 @@ const BaseItemImage = (
id?: null | string;
itemType: LibraryItem;
serverId?: null | string;
size?: number;
src?: null | string;
thumbHash?: null | string;
type?: keyof z.infer<typeof GeneralSettingsSchema>['imageRes'];
},
) => {
const { blurHash, dominantColor, explicitStatus, serverId, src, thumbHash, ...rest } = props;
const { blurHash, dominantColor, explicitStatus, serverId, size, src, thumbHash, ...rest } =
props;
const { blurExplicitImages } = useGeneralSettings();
const imagePlaceholderPriority = useImagePlaceholderPriority();
const hashUrl = useImageHashUrl(thumbHash, blurHash, dominantColor, imagePlaceholderPriority);
@@ -58,6 +60,7 @@ const BaseItemImage = (
imageUrl: src,
itemType: props.itemType,
serverId: serverId || undefined,
size,
type: props.type,
});
@@ -66,6 +69,7 @@ const BaseItemImage = (
imageUrl: src,
itemType: props.itemType,
serverId: serverId || undefined,
size,
type: props.type,
});
@@ -174,9 +174,9 @@ export const AlbumGroupHeader = ({
enableViewport={false}
id={song?.imageId}
itemType={LibraryItem.SONG}
size={albumImageSize}
src={song?.imageUrl}
thumbHash={song?.thumbHash}
type="table"
/>
{isImageHovered && onPlay && (
<div className={imageColumnStyles.playButtonOverlay}>
@@ -82,7 +82,6 @@ export const TableConfig = ({
const albumGroupVerticalLayout = useSettingsStore(
(state) => state.general.albumGroupVerticalLayout,
);
const imageResTable = useSettingsStore((state) => state.general.imageRes.table);
const { setList, setSettings } = useSettingsStoreActions();
const [albumGroupOpen, setAlbumGroupOpen] = useState(false);
@@ -142,14 +141,7 @@ export const TableConfig = ({
),
);
setSettings({
general: {
albumGroupImageSize: size,
// Source table art must be at least as
// large as the displayed album image.
...(size >= imageResTable
? { imageRes: { table: size } }
: {}),
},
general: { albumGroupImageSize: size },
});
}}
rightSection={
@@ -392,7 +384,6 @@ export const TableConfig = ({
albumGroupImageSize,
albumGroupShowFavoriteRating,
albumGroupVerticalLayout,
imageResTable,
setSettings,
]);