file-show: use folder name as album name, in system integration
Massimo Melina committed
Feb 3, 2024 at 17:32 UTC
a8fc5ceb7c4e0be67243127b119b169ad9ec1dac
1 file changed
+2
-1
frontend/src/show.ts
+2
-1
@@ -1,6 +1,6 @@
1
import { DirEntry, DirList, ext2type, state, useSnapState } from './state'
2
import { createElement as h, Fragment, useEffect, useRef, useState } from 'react'
3
-import { domOn, hfsEvent, hIcon, newDialog, restartAnimation } from './misc'
3
+import { basename, dirname, domOn, hfsEvent, hIcon, newDialog, restartAnimation } from './misc'
4
import { useEventListener, useWindowSize } from 'usehooks-ts'
5
import { EntryDetails, useMidnight } from './BrowseFiles'
6
import { Btn, FlexV, iconBtn, Spinner } from './components'
@@ -145,6 +145,7 @@ export function fileShow(entry: DirEntry) {
145
&& x.name.match(/(?:folder|cover|albumart.*)\.jpe?g$/i))
146
navigator.mediaSession.metadata = new MediaMetadata({
147
title: cur.name,
148
+ album: decodeURIComponent(basename(dirname(cur.uri))),
149
artwork: covers.map(x => ({ src: x.n }))
150
})
151
}