File tree Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Expand file tree Collapse file tree 1 file changed +3
-8
lines changed Original file line number Diff line number Diff line change 6161 </div >
6262 <div
6363 style =" height : 50px ; display : flex ; align-items : center ; margin-left : 10px ; margin-right : 10px "
64- @mouseover =" fetchPreviewUrl(mapping.provider_domain, mapping.item_id)"
6564 >
66- <audio controls :src =" previewUrls[`${ mapping.provider_domain}.${ mapping.item_id}`] " />
65+ <audio controls :src =" getPreviewUrl( mapping.provider_domain, mapping.item_id) " />
6766 </div >
6867 </div >
6968 </div >
@@ -87,7 +86,6 @@ export interface Props {
8786 enablePreview? : boolean ;
8887}
8988const compProps = defineProps <Props >();
90- const previewUrls = reactive <Record <string , string >>({});
9189
9290const uniqueProviders = computed (() => {
9391 const keys: string [] = [];
@@ -105,11 +103,8 @@ const uniqueProviders = computed(() => {
105103// window.open(prov.url, "_blank");
106104// };
107105
108- const fetchPreviewUrl = async function (provider : string , item_id : string ) {
109- const key = ` ${provider }.${item_id } ` ;
110- if (key in previewUrls ) return ;
111- const url = await api .getTrackPreviewUrl (provider , item_id );
112- previewUrls [key ] = url ;
106+ const getPreviewUrl = function (provider : string , item_id : string ) {
107+ return ` /preview?provider=${provider }&item_id=${encodeURIComponent (item_id )} `
113108};
114109 </script >
115110
You can’t perform that action at this time.
0 commit comments