Make the UI use the new ShareURL option
This commit is contained in:
+15
-5
@@ -7,24 +7,34 @@ export const baseUrl = (path) => {
|
||||
return parts.join('/')
|
||||
}
|
||||
|
||||
export const shareUrl = (id) => {
|
||||
export const shareUrl = (path) => {
|
||||
if (config.shareURL !== '') {
|
||||
const base = config.shareURL || ''
|
||||
const parts = [base]
|
||||
parts.push(path.replace(/^\//, ''))
|
||||
return parts.join('/')
|
||||
}
|
||||
return baseUrl(path)
|
||||
}
|
||||
|
||||
export const sharePlayerUrl = (id) => {
|
||||
const url = new URL(
|
||||
baseUrl(config.publicBaseUrl + '/' + id),
|
||||
shareUrl(config.publicBaseUrl + '/' + id),
|
||||
window.location.href,
|
||||
)
|
||||
return url.href
|
||||
}
|
||||
|
||||
export const shareStreamUrl = (id) => {
|
||||
return baseUrl(config.publicBaseUrl + '/s/' + id)
|
||||
return shareUrl(config.publicBaseUrl + '/s/' + id)
|
||||
}
|
||||
|
||||
export const shareDownloadUrl = (id) => {
|
||||
return baseUrl(config.publicBaseUrl + '/d/' + id)
|
||||
return shareUrl(config.publicBaseUrl + '/d/' + id)
|
||||
}
|
||||
|
||||
export const shareCoverUrl = (id) => {
|
||||
return baseUrl(config.publicBaseUrl + '/img/' + id + '?size=300')
|
||||
return shareUrl(config.publicBaseUrl + '/img/' + id + '?size=300')
|
||||
}
|
||||
|
||||
export const docsUrl = (path) => `https://www.navidrome.org${path}`
|
||||
|
||||
Reference in New Issue
Block a user