Fix: type toggle missing name attr, vinyl-style cover-centric feed, RSS button in header

This commit is contained in:
2026-07-15 11:05:53 +02:00
parent 684f2d320a
commit 082aab5d8b
7 changed files with 72 additions and 23 deletions
@@ -98,11 +98,8 @@ public class ArtistResource {
public TemplateInstance toggleType(@PathParam("mbid") String mbid,
@FormParam("primaryType") String primaryType,
@FormParam("enabled") boolean enabled) {
FollowedArtist artist = artistService.findArtist(mbid);
if (artist != null) {
artistService.setTypeEnabled(artist, primaryType, enabled);
CompletableFuture.runAsync(() -> syncService.resyncArtist(mbid));
}
artistService.setTypeEnabled(mbid, primaryType, enabled);
CompletableFuture.runAsync(() -> syncService.resyncArtist(mbid));
return feedFragment(0, true);
}
@@ -63,7 +63,11 @@ public class ArtistService {
}
@Transactional
public void setTypeEnabled(FollowedArtist artist, String primaryType, boolean enabled) {
public void setTypeEnabled(String mbid, String primaryType, boolean enabled) {
FollowedArtist artist = FollowedArtist.findByMbid(mbid);
if (artist == null) {
return;
}
for (ArtistTypeSetting s : ArtistTypeSetting.findByArtist(artist)) {
if (s.primaryType.equalsIgnoreCase(primaryType)) {
s.enabled = enabled;
@@ -10,3 +10,38 @@ input[type="search"]::-webkit-search-cancel-button {
-webkit-appearance: none;
appearance: none;
}
/* Vinyl-style cover art in feed */
.vinyl-wrap {
border-radius: 50%;
overflow: hidden;
position: relative;
box-shadow:
0 0 0 3px rgba(0,0,0,0.3),
0 0 0 4px rgba(255,255,255,0.05),
0 4px 12px rgba(0,0,0,0.4);
background: #1a1a1a;
}
.vinyl-cover {
border-radius: 50%;
transition: transform 0.4s ease;
}
.vinyl-wrap:hover .vinyl-cover {
transform: rotate(8deg);
}
/* Center spindle hole */
.vinyl-hole {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 14px;
height: 14px;
border-radius: 50%;
background: #0b0f19;
border: 2px solid rgba(255,255,255,0.15);
pointer-events: none;
}
@@ -20,6 +20,9 @@
</div>
<div class="flex items-center gap-2">
<a href="/" class="btn btn-ghost btn-sm">Feed</a>
<a href="/rss" class="btn btn-ghost btn-circle" aria-label="RSS feed" title="RSS feed">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="currentColor" viewBox="0 0 24 24"><path d="M6.18 15.64a2.18 2.18 0 012.18 2.18C8.36 19 7.38 20 6.18 20C5 20 4 19 4 17.82a2.18 2.18 0 012.18-2.18M4 4.44A15.56 15.56 0 0119.56 20h-2.83A12.73 12.73 0 004 7.27V4.44m0 5.66a9.9 9.9 0 019.9 9.9h-2.83A7.07 7.07 0 004 12.93V10.1z"/></svg>
</a>
<button id="theme-switcher" class="btn btn-ghost btn-circle" aria-label="Toggle theme" onclick="DiscDrop.toggleTheme()">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12.79A9 9 0 1111.21 3 7 7 0 0021 12.79z"/></svg>
</button>
@@ -20,6 +20,7 @@
{#for s in settings}
<label class="label cursor-pointer gap-1 badge badge-outline py-2">
<input type="checkbox"
name="enabled"
class="checkbox checkbox-xs"
value="true"
{#if s.enabled}checked{/if}
@@ -1,22 +1,27 @@
<div class="flex gap-3 items-center bg-base-100 rounded-box border border-base-300 p-3 shadow-sm">
<img src="https://coverartarchive.org/release-group/{row.mbid}/front"
alt="cover"
loading="lazy"
class="w-16 h-16 rounded object-cover bg-base-200"
onerror="this.onerror=null;this.src='/img/no-cover.svg'"/>
<div class="flex-1 min-w-0">
<div class="flex flex-wrap items-center gap-2">
<span class="font-semibold truncate">{row.artist.name}</span>
{#if row.primaryType??}<span class="badge badge-primary badge-sm">{row.primaryType}</span>{/if}
{#if row.secondaryTypes??}<span class="badge badge-ghost badge-sm">{row.secondaryTypes}</span>{/if}
<div class="flex gap-4 items-stretch bg-base-100 rounded-box border border-base-300 p-3 shadow-sm">
<div class="relative shrink-0">
<div class="vinyl-wrap w-28 h-28">
<img src="https://coverartarchive.org/release-group/{row.mbid}/front"
alt="cover"
loading="lazy"
class="vinyl-cover w-full h-full object-cover"
onerror="this.onerror=null;this.src='/img/no-cover.svg'"/>
<div class="vinyl-hole"></div>
</div>
<a href="{row.mbzUrl}" target="_blank" rel="noopener" class="link link-hover text-base-content/90 block truncate">
</div>
<div class="flex-1 min-w-0 flex flex-col justify-center gap-1">
<div class="font-semibold text-sm text-base-content/70 truncate">{row.artist.name}</div>
<a href="{row.mbzUrl}" target="_blank" rel="noopener"
class="link link-hover text-lg font-bold leading-tight block truncate">
{row.title}
</a>
</div>
<div class="text-right text-sm text-base-content/70 shrink-0">
{#if row.firstReleaseDateRaw??}{row.firstReleaseDateRaw}{#else}—{/if}
<div class="flex flex-wrap items-center gap-2 mt-1">
{#if row.primaryType??}<span class="badge badge-primary badge-sm">{row.primaryType}</span>{/if}
{#if row.secondaryTypes??}<span class="badge badge-ghost badge-sm">{row.secondaryTypes}</span>{/if}
<span class="text-sm text-base-content/60">
{#if row.firstReleaseDateRaw??}{row.firstReleaseDateRaw}{#else}—{/if}
</span>
</div>
</div>
</div>
+4
View File
@@ -56,6 +56,10 @@
<svg id="theme-icon-sun" xmlns="http://www.w3.org/2000/svg" class="h-5 w-5 hidden" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z"/></svg>
</button>
<a href="/rss" class="btn btn-ghost btn-circle" aria-label="RSS feed" title="RSS feed">
<svg xmlns="http://www.w3.org/2000/svg" class="h-5 w-5" fill="currentColor" viewBox="0 0 24 24"><path d="M6.18 15.64a2.18 2.18 0 012.18 2.18C8.36 19 7.38 20 6.18 20C5 20 4 19 4 17.82a2.18 2.18 0 012.18-2.18M4 4.44A15.56 15.56 0 0119.56 20h-2.83A12.73 12.73 0 004 7.27V4.44m0 5.66a9.9 9.9 0 019.9 9.9h-2.83A7.07 7.07 0 004 12.93V10.1z"/></svg>
</a>
<a href="/artists" class="btn btn-ghost btn-sm" aria-label="Artists">Artists</a>
</div>
</div>