What you pay for, what Discord drops, and pixiv switched off #251

Merged
bvandeusen merged 37 commits from dev into main 2026-09-13 12:09:28 -04:00
2 changed files with 13 additions and 9 deletions
Showing only changes of commit e3c516d6be - Show all commits
+7 -6
View File
@@ -1,9 +1,13 @@
// Single source of truth for platform → color + icon mapping. Used by
// PlatformChip and any other GS-style platform-tagged surface. The five
// PlatformChip and any other GS-style platform-tagged surface. The four
// platforms FC supports map 1:1 to the GS palette; unknown platforms fall
// back to grey + mdi-web — which is deliberately what a retired platform
// hits: a pre-#3069 deviantart source row still renders, as its raw key on
// a grey chip. Operator-confirmed scope 2026-05-27. The ICONS key set is
// hits: a pre-#3069 deviantart source row, or a post from pixiv (retired at
// milestone #406), still renders, as its raw key on a grey chip. So a
// retired platform is REMOVED from these maps, never kept "so old rows
// look right" — the fallback is what makes old rows look right, and keeping
// the entry would break the contract pin below. Operator-confirmed scope
// 2026-05-27. The ICONS key set is
// pinned against backend known_platform_keys() by
// tests/test_fe_be_contract.py.
@@ -12,7 +16,6 @@ const ICONS = {
subscribestar: 'mdi-star',
hentaifoundry: 'mdi-palette',
discord: 'mdi-discord',
pixiv: 'mdi-alpha-p-box',
}
const COLORS = {
@@ -20,7 +23,6 @@ const COLORS = {
subscribestar: 'amber',
hentaifoundry: 'purple',
discord: 'indigo',
pixiv: 'blue',
}
const LABELS = {
@@ -28,7 +30,6 @@ const LABELS = {
subscribestar: 'SubscribeStar',
hentaifoundry: 'HentaiFoundry',
discord: 'Discord',
pixiv: 'Pixiv',
}
export function platformIcon(platform) {
+6 -3
View File
@@ -388,14 +388,17 @@ async def test_update_while_enabled_keeps_failure_state(db):
async def _source_with_content(db, svc, artist):
"""A source under `artist` with one post + one image it contributed."""
from backend.app.models import ImageProvenance, ImageRecord, Post
# Any registered platform will do — reassign never reads the platform, and
# never moves files (the storage path is immutable). This used pixiv until
# pixiv was retired (milestone #406) and `create` began refusing it.
rec = await svc.create(
artist_id=artist.id, platform="pixiv",
url=f"https://www.pixiv.net/users/{artist.id}",
artist_id=artist.id, platform="hentaifoundry",
url=f"https://www.hentai-foundry.com/user/{artist.slug}/profile",
)
post = Post(source_id=rec.id, artist_id=artist.id, external_post_id="p1")
db.add(post)
img = ImageRecord(
path=f"/images/{artist.slug}/pixiv/pixiv/1_a_00.jpg",
path=f"/images/{artist.slug}/hentaifoundry/hentaifoundry/1_a_00.jpg",
sha256=str(artist.id).rjust(64, "0"), size_bytes=1, mime="image/jpeg",
width=1, height=1, origin="imported_filesystem",
integrity_status="unknown", artist_id=artist.id,