feat: Your genres leads with the genres you play most, not A to Z
release / web (push) Successful in 1m8s
release / go (push) Successful in 1m40s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 3m43s
release / android (push) Successful in 4m21s
release / Build signed APK (push) Successful in 4m55s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 22s
release / Verify release artifacts (tag releases only) (push) Skipped
release / web (push) Successful in 1m8s
release / go (push) Successful in 1m40s
release / govulncheck (push) Successful in 18s
release / integration (push) Successful in 3m43s
release / android (push) Successful in 4m21s
release / Build signed APK (push) Successful in 4m55s
release / Attach APK to the Release (tag releases only) (push) Skipped
release / Build + push container image (push) Successful in 22s
release / Verify release artifacts (tag releases only) (push) Skipped
The genre mix builder already ranks genres by how much you listen to them (taste profile, then plays and likes, then library size), but the rank was lost when the mixes were stored and both apps sorted the shelf by name. Each playlist now has a shelf_rank (migration 0107), which the genre builder fills 1..n in that listening order, even where it picked a narrower genre before a broader one. The list and detail endpoints carry it, and the web and Android Home sort the genre shelf by it, unranked playlists after by name. Android's playlist cache gains the column (Room v14). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
import { describe, expect, test } from 'vitest';
|
||||
import type { Playlist } from '#lib/api/types.js';
|
||||
import { assignShelfCovers, refreshedLabel, shelfMeta, shelfTileWidth, songsLikeArtist, washTone } from './shelf.js';
|
||||
import {
|
||||
assignShelfCovers,
|
||||
byShelfRank,
|
||||
refreshedLabel,
|
||||
shelfMeta,
|
||||
shelfTileWidth,
|
||||
songsLikeArtist,
|
||||
washTone
|
||||
} from './shelf.js';
|
||||
|
||||
function pl(over: Partial<Playlist>): Playlist {
|
||||
return {
|
||||
@@ -149,3 +157,22 @@ describe('shelfTileWidth', () => {
|
||||
expect(shelfTileWidth(100, 5, 150, 16)).toBe(150);
|
||||
});
|
||||
});
|
||||
|
||||
describe('byShelfRank', () => {
|
||||
test('ranked mixes lead in rank order, the unranked follow by name', () => {
|
||||
const shelf = [
|
||||
pl({ name: 'Ambient mix', shelf_rank: 3 }),
|
||||
pl({ name: 'Zydeco mix' }),
|
||||
pl({ name: 'Pop mix', shelf_rank: 1 }),
|
||||
pl({ name: 'Blues mix' }),
|
||||
pl({ name: 'Jazz mix', shelf_rank: 2 })
|
||||
];
|
||||
expect([...shelf].sort(byShelfRank).map((p) => p.name)).toEqual([
|
||||
'Pop mix',
|
||||
'Jazz mix',
|
||||
'Ambient mix',
|
||||
'Blues mix',
|
||||
'Zydeco mix'
|
||||
]);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user