[READ-ONLY] Mirror of https://github.com/FoxxMD/multi-scrobbler. Scrobble plays from multiple sources to multiple clients docs.multi-scrobbler.app
deezer docker jellyfin koito lastfm listenbrainz maloja mopidy mpris music music-assistant plex scrobble self-hosted spotify subsonic tautulli youtube-music
0

Configure Feed

Select the types of activity you want to include in your feed.

Better args default for stories

FoxxMD (Mar 18, 2026, 6:19 PM UTC) e118dc5d 1a23491a

+19 -15
+19 -15
src/stories/PlayInfo.stories.tsx
··· 2 2 import React from 'react'; 3 3 4 4 import { fn } from 'storybook/test'; 5 - import { PlayInfo } from "../client/components/PlayInfo"; 5 + import { PlayInfo, PlayInfoContainer } from "../client/components/PlayInfo"; 6 6 import {Provider} from "../client/components/Provider"; 7 7 import { generateArtists, generateJsonPlay, generatePlay } from "../backend/tests/utils/PlayTestUtils" 8 8 import clone from "clone"; 9 9 10 10 type PropsAndCustomArgs = React.ComponentProps<typeof PlayInfo> & { 11 11 includeAlbumArtists?: boolean; 12 + defaultFinal?: boolean 12 13 }; 13 14 // More on how to set up stories at: https://storybook.js.org/docs/writing-stories#default-export 14 15 const meta = preview.type<{args: PropsAndCustomArgs}>().meta({ 15 16 title: 'Examples/PlayInfo', 16 - component: PlayInfo, 17 + component: PlayInfoContainer, 17 18 parameters: { 18 19 // Optional parameter to center the component in the Canvas. More info: https://storybook.js.org/docs/configure/story-layout 19 20 layout: 'padded', ··· 23 24 decorators: [ 24 25 (Story) => (<Provider><Story/></Provider>), 25 26 ], 27 + args: { 28 + play: generateJsonPlay(), 29 + includeAlbumArtists: false, 30 + showCodeToggle: true, 31 + defaultFinal: true 32 + }, 26 33 // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args 27 34 }); 28 35 29 - const orig = generateJsonPlay(); 30 - orig.data.playDateCompleted = orig.data.playDate; 31 - const final = clone(orig); 32 - final.data.track = `${final.data.track} (Album Version)`; 33 - 34 36 // More on writing stories with args: https://storybook.js.org/docs/writing-stories/args 35 37 export const PlayInfoStory = meta.story({ 36 - args: { 37 - play: orig, 38 - final, 39 - includeAlbumArtists: false, 40 - showCodeToggle: true 41 - }, 42 38 render: function Render(args) { 39 + 40 + if(args.defaultFinal && args.final === undefined) { 41 + const final = clone(args.play); 42 + final.data.track = `${final.data.track} (Album Version)`; 43 + args.final = final; 44 + } 43 45 44 46 if(args.includeAlbumArtists && (args.play.data.albumArtists === undefined || args.play.data.albumArtists.length === 0)) { 45 47 const aa = generateArtists(undefined, 2); 46 48 args.play.data.albumArtists = aa; 47 - args.final.data.albumArtists = aa; 49 + if(args.final !== undefined) { 50 + args.final.data.albumArtists = aa; 51 + } 48 52 } 49 - return (<PlayInfo {...args}/>) 53 + return (<PlayInfoContainer {...args}/>) 50 54 } 51 55 });