Skip to content

Commit

Permalink
Fix sorting
Browse files Browse the repository at this point in the history
  • Loading branch information
switz committed Dec 13, 2023
1 parent 69e0560 commit bfd910e
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
1 change: 0 additions & 1 deletion src/app/(main)/NavBar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ export default async function NavBar() {
<div className="navigation relative flex h-[50px] max-h-[50px] min-h-[50px] grid-cols-3 justify-between border-b-[1px] border-b-[#aeaeae] bg-white text-[#333333] lg:grid">
<MainNavHeader artistSlugsToName={artistSlugsToName} />
<div className="player min-w-[60%] flex-1 text-center lg:min-w-[44vw] xl:min-w-[38vw]">

<Player artistSlugsToName={artistSlugsToName} />
</div>
<SimplePopover content={<Menu />}>
Expand Down
4 changes: 3 additions & 1 deletion src/components/Player.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ const Player = ({ artistSlugsToName }: Props) => {
onClick={() => player.togglePlayPause()}
>
<i
className={`fas fa cursor-pointer fa-${playback.activeTrack.isPaused ? 'play' : 'pause'}`}
className={`fas fa cursor-pointer fa-${
playback.activeTrack.isPaused ? 'play' : 'pause'
}`}
/>
</Flex>
)}
Expand Down
12 changes: 8 additions & 4 deletions src/redux/modules/tapes.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,15 +64,19 @@ const sortTapes = (data = {}) => {
const sortedTapes =
data && data.sources
? [...data.sources].sort(
firstBy((t) => t.is_soundboard)
firstBy((t) => t.is_soundboard, 'desc')
// Charlie for GD, Pete for JRAD
.thenBy((t) =>
/(charlie miller)|(peter costello)/i.test([t.taper, t.transferrer, t.source].join(''))
/(charlie miller)|(peter costello)/i.test(
[t.taper, t.transferrer, t.source].join(''),
'desc'
)
)
.thenBy(
(t1, t2) => getEtreeId(t1.upstream_identifier) - getEtreeId(t2.upstream_identifier)
(t1, t2) => getEtreeId(t1.upstream_identifier) - getEtreeId(t2.upstream_identifier),
'desc'
)
.thenBy((t) => t.avg_rating_weighted)
.thenBy((t) => t.avg_rating_weighted, 'desc')
)
: [];

Expand Down

0 comments on commit bfd910e

Please sign in to comment.