ConvertSpotifySongs.vue 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603
  1. <script setup lang="ts">
  2. import {
  3. defineProps,
  4. defineAsyncComponent,
  5. onMounted,
  6. ref,
  7. reactive,
  8. computed
  9. } from "vue";
  10. import Toast from "toasters";
  11. import { useModalsStore } from "@/stores/modals";
  12. import { useWebsocketsStore } from "@/stores/websockets";
  13. const Modal = defineAsyncComponent(() => import("@/components/Modal.vue"));
  14. const SongItem = defineAsyncComponent(
  15. () => import("@/components/SongItem.vue")
  16. );
  17. const QuickConfirm = defineAsyncComponent(
  18. () => import("@/components/QuickConfirm.vue")
  19. );
  20. const { openModal, closeCurrentModal } = useModalsStore();
  21. const { socket } = useWebsocketsStore();
  22. const TAG = "CSS";
  23. const props = defineProps({
  24. modalUuid: { type: String, required: true },
  25. playlistId: { type: String, default: null }
  26. });
  27. const playlist = ref(null);
  28. const spotifySongs = ref([]);
  29. const spotifyTracks = reactive({});
  30. const spotifyAlbums = reactive({});
  31. const spotifyArtists = reactive({});
  32. const loadingPlaylist = ref(false);
  33. const loadedPlaylist = ref(false);
  34. const loadingSpotifyTracks = ref(false);
  35. const loadedSpotifyTracks = ref(false);
  36. const loadingSpotifyAlbums = ref(false);
  37. const loadedSpotifyAlbums = ref(false);
  38. const gettingAllAlternativeMediaPerTrack = ref(false);
  39. const gotAllAlternativeMediaPerTrack = ref(false);
  40. const alternativeMediaPerTrack = reactive({});
  41. const gettingAllAlternativeAlbums = ref(false);
  42. const gotAllAlternativeAlbums = ref(false);
  43. const alternativeAlbumsPerAlbum = reactive({});
  44. const alternativeMediaMap = reactive({});
  45. const alternativeMediaFailedMap = reactive({});
  46. const gettingMissingAlternativeMedia = ref(false);
  47. const replacingAllSpotifySongs = ref(false);
  48. const currentConvertType = ref<"track" | "album" | "artist">("track");
  49. const showReplaceButtonPerAlternative = ref(false);
  50. const hideSpotifySongsWithNoAlternativesFound = ref(false);
  51. const preferredAlternativeSongMode = ref<
  52. "FIRST" | "LYRICS" | "TOPIC" | "LYRICS_TOPIC" | "TOPIC_LYRICS"
  53. >("FIRST");
  54. // const singleMode = ref(false);
  55. const showExtra = ref(false);
  56. const collectAlternativeMediaSourcesOrigins = ref(false);
  57. const minimumSongsPerAlbum = ref(2);
  58. const sortAlbumMode = ref<
  59. "SONG_COUNT_ASC" | "SONG_COUNT_DESC" | "NAME_DESC" | "NAME_ASC"
  60. >("SONG_COUNT_ASC");
  61. const showDontConvertButton = ref(true);
  62. const replaceSongUrlMap = reactive({});
  63. const showReplacementInputs = ref(false);
  64. const youtubeVideoUrlRegex =
  65. /^(https?:\/\/)?(www\.)?(m\.)?(music\.)?(youtube\.com|youtu\.be)\/(watch\?v=)?(?<youtubeId>[\w-]{11})((&([A-Za-z0-9]+)?)*)?$/;
  66. const youtubeVideoIdRegex = /^([\w-]{11})$/;
  67. const filteredSpotifySongs = computed(() =>
  68. hideSpotifySongsWithNoAlternativesFound.value
  69. ? spotifySongs.value.filter(
  70. spotifySong =>
  71. (!gettingAllAlternativeMediaPerTrack.value &&
  72. !gotAllAlternativeMediaPerTrack.value) ||
  73. (alternativeMediaPerTrack[spotifySong.mediaSource] &&
  74. alternativeMediaPerTrack[spotifySong.mediaSource]
  75. .mediaSources.length > 0)
  76. )
  77. : spotifySongs.value
  78. );
  79. const filteredSpotifyAlbums = computed(() => {
  80. let albums = Object.values(spotifyAlbums);
  81. albums = albums.filter(
  82. album => album.songs.length >= minimumSongsPerAlbum.value
  83. );
  84. let sortFn = null;
  85. if (sortAlbumMode.value === "SONG_COUNT_ASC")
  86. sortFn = (albumA, albumB) => albumA.songs.length - albumB.songs.length;
  87. else if (sortAlbumMode.value === "SONG_COUNT_DESC")
  88. sortFn = (albumA, albumB) => albumB.songs.length - albumA.songs.length;
  89. else if (loadedSpotifyAlbums.value && sortAlbumMode.value === "NAME_ASC")
  90. sortFn = (albumA, albumB) => {
  91. const nameA = albumA.rawData?.name?.toLowerCase();
  92. const nameB = albumB.rawData?.name?.toLowerCase();
  93. if (nameA === nameB) return 0;
  94. if (nameA < nameB) return -1;
  95. if (nameA > nameB) return 1;
  96. };
  97. else if (loadedSpotifyAlbums.value && sortAlbumMode.value === "NAME_DESC")
  98. sortFn = (albumA, albumB) => {
  99. const nameA = albumA.rawData?.name?.toLowerCase();
  100. const nameB = albumB.rawData?.name?.toLowerCase();
  101. if (nameA === nameB) return 0;
  102. if (nameA > nameB) return -1;
  103. if (nameA < nameB) return 1;
  104. };
  105. if (sortFn) albums = albums.sort(sortFn);
  106. return albums;
  107. });
  108. const missingMediaSources = computed(() => {
  109. const missingMediaSources = [];
  110. Object.values(alternativeMediaPerTrack).forEach(({ mediaSources }) => {
  111. mediaSources.forEach(mediaSource => {
  112. if (
  113. !alternativeMediaMap[mediaSource] &&
  114. !alternativeMediaFailedMap[mediaSource] &&
  115. missingMediaSources.indexOf(mediaSource) === -1
  116. )
  117. missingMediaSources.push(mediaSource);
  118. });
  119. });
  120. return missingMediaSources;
  121. });
  122. const preferredAlternativeSongPerTrack = computed(() => {
  123. const returnObject = {};
  124. Object.entries(alternativeMediaPerTrack).forEach(
  125. ([spotifyMediaSource, { mediaSources }]) => {
  126. returnObject[spotifyMediaSource] = null;
  127. if (mediaSources.length === 0) return;
  128. let sortFn = (mediaSourceA, mediaSourceB) => {
  129. if (preferredAlternativeSongMode.value === "FIRST") return 0;
  130. const aHasLyrics =
  131. alternativeMediaMap[mediaSourceA].title
  132. .toLowerCase()
  133. .indexOf("lyric") !== -1;
  134. const aHasTopic =
  135. alternativeMediaMap[mediaSourceA].artists[0]
  136. .toLowerCase()
  137. .indexOf("topic") !== -1;
  138. const bHasLyrics =
  139. alternativeMediaMap[mediaSourceB].title
  140. .toLowerCase()
  141. .indexOf("lyric") !== -1;
  142. const bHasTopic =
  143. alternativeMediaMap[mediaSourceB].artists[0]
  144. .toLowerCase()
  145. .indexOf("topic") !== -1;
  146. if (preferredAlternativeSongMode.value === "LYRICS") {
  147. if (aHasLyrics && bHasLyrics) return 0;
  148. if (aHasLyrics && !bHasLyrics) return -1;
  149. if (!aHasLyrics && bHasLyrics) return 1;
  150. return 0;
  151. }
  152. if (preferredAlternativeSongMode.value === "TOPIC") {
  153. if (aHasTopic && bHasTopic) return 0;
  154. if (aHasTopic && !bHasTopic) return -1;
  155. if (!aHasTopic && bHasTopic) return 1;
  156. return 0;
  157. }
  158. if (preferredAlternativeSongMode.value === "LYRICS_TOPIC") {
  159. if (aHasLyrics && bHasLyrics) return 0;
  160. if (aHasLyrics && !bHasLyrics) return -1;
  161. if (!aHasLyrics && bHasLyrics) return 1;
  162. if (aHasTopic && bHasTopic) return 0;
  163. if (aHasTopic && !bHasTopic) return -1;
  164. if (!aHasTopic && bHasTopic) return 1;
  165. return 0;
  166. }
  167. if (preferredAlternativeSongMode.value === "TOPIC_LYRICS") {
  168. if (aHasTopic && bHasTopic) return 0;
  169. if (aHasTopic && !bHasTopic) return -1;
  170. if (!aHasTopic && bHasTopic) return 1;
  171. if (aHasLyrics && bHasLyrics) return 0;
  172. if (aHasLyrics && !bHasLyrics) return -1;
  173. if (!aHasLyrics && bHasLyrics) return 1;
  174. return 0;
  175. }
  176. };
  177. if (
  178. mediaSources.length === 1 ||
  179. preferredAlternativeSongMode.value === "FIRST"
  180. )
  181. sortFn = () => 0;
  182. else if (preferredAlternativeSongMode.value === "LYRICS")
  183. sortFn = mediaSourceA => {
  184. if (!alternativeMediaMap[mediaSourceA]) return 0;
  185. if (
  186. alternativeMediaMap[mediaSourceA].title
  187. .toLowerCase()
  188. .indexOf("lyric") !== -1
  189. )
  190. return -1;
  191. return 1;
  192. };
  193. else if (preferredAlternativeSongMode.value === "TOPIC")
  194. sortFn = mediaSourceA => {
  195. if (!alternativeMediaMap[mediaSourceA]) return 0;
  196. if (
  197. alternativeMediaMap[mediaSourceA].artists[0]
  198. .toLowerCase()
  199. .indexOf("topic") !== -1
  200. )
  201. return -1;
  202. return 1;
  203. };
  204. const [firstMediaSource] = mediaSources
  205. .slice()
  206. .filter(mediaSource => !!alternativeMediaMap[mediaSource])
  207. .sort(sortFn);
  208. returnObject[spotifyMediaSource] = firstMediaSource;
  209. }
  210. );
  211. return returnObject;
  212. });
  213. const replaceAllSpotifySongs = async () => {
  214. if (replacingAllSpotifySongs.value) return;
  215. replacingAllSpotifySongs.value = true;
  216. const replaceArray = [];
  217. spotifySongs.value.forEach(spotifySong => {
  218. const spotifyMediaSource = spotifySong.mediaSource;
  219. const replacementMediaSource =
  220. preferredAlternativeSongPerTrack.value[spotifyMediaSource];
  221. if (!spotifyMediaSource || !replacementMediaSource) return;
  222. replaceArray.push([spotifyMediaSource, replacementMediaSource]);
  223. });
  224. const promises = replaceArray.map(
  225. ([spotifyMediaSource, replacementMediaSource]) =>
  226. new Promise<void>(resolve => {
  227. socket.dispatch(
  228. "playlists.replaceSongInPlaylist",
  229. spotifyMediaSource,
  230. replacementMediaSource,
  231. props.playlistId,
  232. res => {
  233. console.log(
  234. "playlists.replaceSongInPlaylist response",
  235. res
  236. );
  237. resolve();
  238. }
  239. );
  240. })
  241. );
  242. Promise.allSettled(promises).finally(() => {
  243. replacingAllSpotifySongs.value = false;
  244. });
  245. };
  246. const replaceSpotifySong = (oldMediaSource, newMediaSource) => {
  247. socket.dispatch(
  248. "playlists.replaceSongInPlaylist",
  249. oldMediaSource,
  250. newMediaSource,
  251. props.playlistId,
  252. res => {
  253. console.log("playlists.replaceSongInPlaylist response", res);
  254. }
  255. );
  256. };
  257. const replaceSongFromUrl = spotifyMediaSource => {
  258. const replacementUrl = replaceSongUrlMap[spotifyMediaSource];
  259. console.log(spotifyMediaSource, replacementUrl);
  260. let newMediaSource = null;
  261. const youtubeVideoUrlRegexMatches =
  262. youtubeVideoUrlRegex.exec(replacementUrl);
  263. console.log(youtubeVideoUrlRegexMatches);
  264. const youtubeVideoIdRegexMatches = youtubeVideoIdRegex.exec(replacementUrl);
  265. console.log(youtubeVideoIdRegexMatches);
  266. if (youtubeVideoUrlRegexMatches)
  267. newMediaSource = `youtube:${youtubeVideoUrlRegexMatches.groups.youtubeId}`;
  268. if (youtubeVideoIdRegexMatches)
  269. newMediaSource = `youtube:${youtubeVideoIdRegexMatches[0]}`;
  270. if (!newMediaSource) return new Toast("Invalid URL/identifier specified.");
  271. replaceSpotifySong(spotifyMediaSource, newMediaSource);
  272. };
  273. const getMissingAlternativeMedia = () => {
  274. if (gettingMissingAlternativeMedia.value) return;
  275. gettingMissingAlternativeMedia.value = true;
  276. const _missingMediaSources = missingMediaSources.value;
  277. console.log("Getting missing", _missingMediaSources);
  278. socket.dispatch(
  279. "media.getMediaFromMediaSources",
  280. _missingMediaSources,
  281. res => {
  282. if (res.status === "success") {
  283. const { songMap } = res.data;
  284. _missingMediaSources.forEach(missingMediaSource => {
  285. if (songMap[missingMediaSource])
  286. alternativeMediaMap[missingMediaSource] =
  287. songMap[missingMediaSource];
  288. else alternativeMediaFailedMap[missingMediaSource] = true;
  289. });
  290. }
  291. gettingMissingAlternativeMedia.value = false;
  292. }
  293. );
  294. };
  295. const getAlternativeAlbums = () => {
  296. if (gettingAllAlternativeAlbums.value || gotAllAlternativeAlbums.value)
  297. return;
  298. gettingAllAlternativeAlbums.value = true;
  299. const albumIds = filteredSpotifyAlbums.value.map(album => album.albumId);
  300. socket.dispatch(
  301. "apis.getAlternativeAlbumSourcesForAlbums",
  302. albumIds,
  303. collectAlternativeMediaSourcesOrigins.value,
  304. {
  305. cb: res => {
  306. console.log(
  307. "apis.getAlternativeAlbumSourcesForAlbums response",
  308. res
  309. );
  310. },
  311. onProgress: data => {
  312. console.log(
  313. "apis.getAlternativeAlbumSourcesForAlbums onProgress",
  314. data
  315. );
  316. if (data.status === "working") {
  317. if (data.data.status === "success") {
  318. const { albumId, result } = data.data;
  319. if (!spotifyAlbums[albumId]) return;
  320. alternativeAlbumsPerAlbum[albumId] = {
  321. youtubePlaylistIds: result
  322. };
  323. }
  324. } else if (data.status === "finished") {
  325. gotAllAlternativeAlbums.value = true;
  326. gettingAllAlternativeAlbums.value = false;
  327. }
  328. }
  329. }
  330. );
  331. };
  332. const getAlternativeMedia = () => {
  333. if (
  334. gettingAllAlternativeMediaPerTrack.value ||
  335. gotAllAlternativeMediaPerTrack.value
  336. )
  337. return;
  338. gettingAllAlternativeMediaPerTrack.value = true;
  339. const mediaSources = spotifySongs.value.map(song => song.mediaSource);
  340. socket.dispatch(
  341. "apis.getAlternativeMediaSourcesForTracks",
  342. mediaSources,
  343. collectAlternativeMediaSourcesOrigins.value,
  344. {
  345. cb: res => {
  346. console.log(
  347. "apis.getAlternativeMediaSourcesForTracks response",
  348. res
  349. );
  350. },
  351. onProgress: data => {
  352. console.log(
  353. "apis.getAlternativeMediaSourcesForTracks onProgress",
  354. data
  355. );
  356. if (data.status === "working") {
  357. if (data.data.status === "success") {
  358. const { mediaSource, result } = data.data;
  359. if (!spotifyTracks[mediaSource]) return;
  360. alternativeMediaPerTrack[mediaSource] = result;
  361. }
  362. } else if (data.status === "finished") {
  363. gotAllAlternativeMediaPerTrack.value = true;
  364. gettingAllAlternativeMediaPerTrack.value = false;
  365. }
  366. }
  367. }
  368. );
  369. };
  370. const loadSpotifyAlbums = () =>
  371. new Promise<void>(resolve => {
  372. console.debug(TAG, "Loading Spotify albums");
  373. loadingSpotifyAlbums.value = true;
  374. const albumIds = filteredSpotifyAlbums.value.map(
  375. album => album.albumId
  376. );
  377. socket.dispatch("spotify.getAlbumsFromIds", albumIds, res => {
  378. console.debug(TAG, "Get albums response", res);
  379. if (res.status !== "success") {
  380. new Toast(res.message);
  381. closeCurrentModal();
  382. return;
  383. }
  384. const { albums } = res.data;
  385. albums.forEach(album => {
  386. spotifyAlbums[album.albumId].rawData = album.rawData;
  387. });
  388. console.debug(TAG, "Loaded Spotify albums");
  389. loadedSpotifyAlbums.value = true;
  390. loadingSpotifyAlbums.value = false;
  391. resolve();
  392. });
  393. });
  394. const loadSpotifyTracks = () =>
  395. new Promise<void>(resolve => {
  396. console.debug(TAG, "Loading Spotify tracks");
  397. loadingSpotifyTracks.value = true;
  398. const mediaSources = spotifySongs.value.map(song => song.mediaSource);
  399. socket.dispatch(
  400. "spotify.getTracksFromMediaSources",
  401. mediaSources,
  402. res => {
  403. console.debug(TAG, "Get tracks response", res);
  404. if (res.status !== "success") {
  405. new Toast(res.message);
  406. closeCurrentModal();
  407. return;
  408. }
  409. const { tracks } = res.data;
  410. Object.entries(tracks).forEach(([mediaSource, track]) => {
  411. spotifyTracks[mediaSource] = track;
  412. const { albumId, albumImageUrl, artistIds, artists } =
  413. track;
  414. if (albumId) {
  415. if (!spotifyAlbums[albumId])
  416. spotifyAlbums[albumId] = {
  417. albumId,
  418. albumImageUrl,
  419. songs: []
  420. };
  421. spotifyAlbums[albumId].songs.push(mediaSource);
  422. }
  423. artistIds.forEach((artistId, artistIndex) => {
  424. if (!spotifyArtists[artistId]) {
  425. spotifyArtists[artistId] = {
  426. artistId,
  427. name: artists[artistIndex],
  428. songs: [],
  429. expanded: false
  430. };
  431. }
  432. spotifyArtists[artistId].songs.push(mediaSource);
  433. });
  434. });
  435. console.debug(TAG, "Loaded Spotify tracks");
  436. loadedSpotifyTracks.value = true;
  437. loadingSpotifyTracks.value = false;
  438. resolve();
  439. }
  440. );
  441. });
  442. const loadPlaylist = () =>
  443. new Promise<void>(resolve => {
  444. console.debug(TAG, `Loading playlist ${props.playlistId}`);
  445. loadingPlaylist.value = true;
  446. socket.dispatch("playlists.getPlaylist", props.playlistId, res => {
  447. console.debug(TAG, "Get playlist response", res);
  448. if (res.status !== "success") {
  449. new Toast(res.message);
  450. closeCurrentModal();
  451. return;
  452. }
  453. playlist.value = res.data.playlist;
  454. spotifySongs.value = playlist.value.songs.filter(song =>
  455. song.mediaSource.startsWith("spotify:")
  456. );
  457. console.debug(TAG, `Loaded playlist ${props.playlistId}`);
  458. loadedPlaylist.value = true;
  459. loadingPlaylist.value = false;
  460. resolve();
  461. });
  462. });
  463. const removeAlternativeTrack = (spotifyMediaSource, alternativeMediaSource) => {
  464. alternativeMediaPerTrack[spotifyMediaSource].mediaSources =
  465. alternativeMediaPerTrack[spotifyMediaSource].mediaSources.filter(
  466. mediaSource => mediaSource !== alternativeMediaSource
  467. );
  468. };
  469. const removeSpotifyTrack = mediaSource => {
  470. const spotifyTrack = spotifyTracks[mediaSource];
  471. if (spotifyTrack) {
  472. delete spotifyTracks[mediaSource];
  473. spotifyTrack.artistIds.forEach(artistId => {
  474. const spotifyArtist = spotifyArtists[artistId];
  475. if (spotifyArtist) {
  476. if (spotifyArtist.songs.length === 1)
  477. delete spotifyArtists[artistId];
  478. else
  479. spotifyArtists[artistId].songs = spotifyArtists[
  480. artistId
  481. ].songs.filter(
  482. _mediaSource => _mediaSource !== mediaSource
  483. );
  484. }
  485. });
  486. const spotifyAlbum = spotifyAlbums[spotifyTrack.albumId];
  487. if (spotifyAlbum) {
  488. if (spotifyAlbum.songs.length === 1)
  489. delete spotifyAlbums[spotifyTrack.albumId];
  490. else
  491. spotifyAlbums[spotifyTrack.albumId].songs = spotifyAlbums[
  492. spotifyTrack.albumId
  493. ].songs.filter(_mediaSource => _mediaSource !== mediaSource);
  494. }
  495. }
  496. };
  497. const removeSpotifySong = mediaSource => {
  498. // remove song
  499. playlist.value.songs = playlist.value.songs.filter(
  500. song => song.mediaSource !== mediaSource
  501. );
  502. spotifySongs.value = spotifySongs.value.filter(
  503. song => song.mediaSource !== mediaSource
  504. );
  505. removeSpotifyTrack(mediaSource);
  506. delete alternativeMediaMap[mediaSource];
  507. delete alternativeMediaFailedMap[mediaSource];
  508. };
  509. onMounted(() => {
  510. console.debug(TAG, "On mounted start");
  511. loadPlaylist().then(loadSpotifyTracks);
  512. socket.on(
  513. "event:playlist.song.removed",
  514. res => {
  515. console.log("SONG REMOVED", res);
  516. if (
  517. loadedPlaylist.value &&
  518. playlist.value._id === res.data.playlistId
  519. ) {
  520. const { oldMediaSource } = res.data;
  521. removeSpotifySong(oldMediaSource);
  522. }
  523. },
  524. { modalUuid: props.modalUuid }
  525. );
  526. socket.on(
  527. "event:playlist.song.replaced",
  528. res => {
  529. console.log(
  530. "SONG REPLACED",
  531. res,
  532. playlist.value._id === res.data.playlistId
  533. );
  534. if (
  535. loadedPlaylist.value &&
  536. playlist.value._id === res.data.playlistId
  537. ) {
  538. const { oldMediaSource } = res.data;
  539. removeSpotifySong(oldMediaSource);
  540. }
  541. },
  542. { modalUuid: props.modalUuid }
  543. );
  544. console.debug(TAG, "On mounted end");
  545. });
  546. </script>
  547. <template>
  548. <div>
  549. <modal
  550. title="Convert Spotify Songs"
  551. class="convert-spotify-songs-modal"
  552. size="wide"
  553. @closed="closeCurrentModal()"
  554. >
  555. <template #body>
  556. <template v-if="loadedPlaylist && spotifySongs.length === 0">
  557. <h2>All Spotify songs have been converted</h2>
  558. <button
  559. class="button is-primary is-fullwidth"
  560. @click="closeCurrentModal()"
  561. >
  562. Close modal
  563. </button>
  564. </template>
  565. <template v-else>
  566. <div class="buttons-options-info-row">
  567. <div class="buttons">
  568. <quick-confirm
  569. v-if="
  570. gotAllAlternativeMediaPerTrack &&
  571. missingMediaSources.length === 0 &&
  572. !replacingAllSpotifySongs
  573. "
  574. placement="top"
  575. @confirm="replaceAllSpotifySongs()"
  576. >
  577. <button class="button is-primary is-fullwidth">
  578. Replace all available songs with provided
  579. prefer settings
  580. </button>
  581. </quick-confirm>
  582. <button
  583. v-if="
  584. loadedSpotifyTracks &&
  585. !gettingAllAlternativeMediaPerTrack &&
  586. !gotAllAlternativeMediaPerTrack &&
  587. currentConvertType === 'track'
  588. "
  589. class="button is-primary"
  590. @click="getAlternativeMedia()"
  591. >
  592. Get alternative media
  593. </button>
  594. <button
  595. v-if="
  596. currentConvertType === 'track' &&
  597. gotAllAlternativeMediaPerTrack &&
  598. !gettingMissingAlternativeMedia &&
  599. missingMediaSources.length > 0
  600. "
  601. class="button is-primary"
  602. @click="getMissingAlternativeMedia()"
  603. >
  604. Get missing alternative media
  605. </button>
  606. <button
  607. v-if="
  608. loadedSpotifyTracks &&
  609. !loadingSpotifyAlbums &&
  610. !loadedSpotifyAlbums &&
  611. currentConvertType === 'album'
  612. "
  613. class="button is-primary"
  614. @click="loadSpotifyAlbums()"
  615. >
  616. Get Spotify albums
  617. </button>
  618. <button
  619. v-if="
  620. loadedSpotifyTracks &&
  621. loadedSpotifyAlbums &&
  622. !gettingAllAlternativeAlbums &&
  623. !gotAllAlternativeAlbums &&
  624. currentConvertType === 'album'
  625. "
  626. class="button is-primary"
  627. @click="getAlternativeAlbums()"
  628. >
  629. Get alternative albums
  630. </button>
  631. </div>
  632. <div class="options">
  633. <p class="is-expanded checkbox-control">
  634. <label class="switch">
  635. <input
  636. type="checkbox"
  637. id="show-extra"
  638. v-model="showExtra"
  639. />
  640. <span class="slider round"></span>
  641. </label>
  642. <label for="show-extra">
  643. <p>Show extra info</p>
  644. </label>
  645. </p>
  646. <p class="is-expanded checkbox-control">
  647. <label class="switch">
  648. <input
  649. type="checkbox"
  650. id="collect-alternative-media-sources-origins"
  651. v-model="
  652. collectAlternativeMediaSourcesOrigins
  653. "
  654. />
  655. <span class="slider round"></span>
  656. </label>
  657. <label
  658. for="collect-alternative-media-sources-origins"
  659. >
  660. <p>
  661. Collect alternative media sources
  662. origins
  663. </p>
  664. </label>
  665. </p>
  666. <p class="is-expanded checkbox-control">
  667. <label class="switch">
  668. <input
  669. type="checkbox"
  670. id="show-replace-button-per-alternative"
  671. v-model="
  672. showReplaceButtonPerAlternative
  673. "
  674. />
  675. <span class="slider round"></span>
  676. </label>
  677. <label
  678. for="show-replace-button-per-alternative"
  679. >
  680. <p>Show replace button per alternative</p>
  681. </label>
  682. </p>
  683. <p class="is-expanded checkbox-control">
  684. <label class="switch">
  685. <input
  686. type="checkbox"
  687. id="showDontConvertButton"
  688. v-model="showDontConvertButton"
  689. />
  690. <span class="slider round"></span>
  691. </label>
  692. <label for="showDontConvertButton">
  693. <p>Show don't convert buttons</p>
  694. </label>
  695. </p>
  696. <p class="is-expanded checkbox-control">
  697. <label class="switch">
  698. <input
  699. type="checkbox"
  700. id="showReplacementInputs"
  701. v-model="showReplacementInputs"
  702. />
  703. <span class="slider round"></span>
  704. </label>
  705. <label for="showReplacementInputs">
  706. <p>Show replacement inputs</p>
  707. </label>
  708. </p>
  709. <p class="is-expanded checkbox-control">
  710. <label class="switch">
  711. <input
  712. type="checkbox"
  713. id="hide-spotify-songs-with-no-alternatives-found"
  714. v-model="
  715. hideSpotifySongsWithNoAlternativesFound
  716. "
  717. />
  718. <span class="slider round"></span>
  719. </label>
  720. <label
  721. for="hide-spotify-songs-with-no-alternatives-found"
  722. >
  723. <p>
  724. Hide Spotify songs with no alternatives
  725. found
  726. </p>
  727. </label>
  728. </p>
  729. <div class="control">
  730. <label class="label"
  731. >Get alternatives per</label
  732. >
  733. <p class="control is-expanded select">
  734. <select
  735. v-model="currentConvertType"
  736. :disabled="
  737. gettingAllAlternativeMediaPerTrack
  738. "
  739. >
  740. <option value="track">Track</option>
  741. <option value="artist">Artist</option>
  742. <option value="album">Album</option>
  743. </select>
  744. </p>
  745. </div>
  746. <div
  747. class="control"
  748. v-if="currentConvertType === 'track'"
  749. >
  750. <label class="label"
  751. >Preferred track mode</label
  752. >
  753. <p class="control is-expanded select">
  754. <select
  755. v-model="preferredAlternativeSongMode"
  756. :disabled="false"
  757. >
  758. <option value="FIRST">
  759. First song
  760. </option>
  761. <option value="LYRICS">
  762. First song with lyrics in title
  763. </option>
  764. <option value="TOPIC">
  765. First song from topic channel
  766. (YouTube only)
  767. </option>
  768. <option value="LYRICS_TOPIC">
  769. First song with lyrics in title, or
  770. from topic channel (YouTube only)
  771. </option>
  772. <option value="TOPIC_LYRICS">
  773. First song from topic channel
  774. (YouTube only), or with lyrics in
  775. title
  776. </option>
  777. </select>
  778. </p>
  779. </div>
  780. <div
  781. class="small-section"
  782. v-if="currentConvertType === 'album'"
  783. >
  784. <label class="label"
  785. >Minimum songs per album</label
  786. >
  787. <div class="control is-expanded">
  788. <input
  789. class="input"
  790. type="number"
  791. min="1"
  792. v-model="minimumSongsPerAlbum"
  793. />
  794. </div>
  795. </div>
  796. <div class="control">
  797. <label class="label">Sort album mode</label>
  798. <p class="control is-expanded select">
  799. <select v-model="sortAlbumMode">
  800. <option value="SONG_COUNT_ASC">
  801. Song count (ascending)
  802. </option>
  803. <option value="SONG_COUNT_DESC">
  804. Song count (descending)
  805. </option>
  806. <option value="NAME_ASC">
  807. Name (ascending)
  808. </option>
  809. <option value="NAME_DESC">
  810. Name (descending)
  811. </option>
  812. </select>
  813. </p>
  814. </div>
  815. </div>
  816. <div class="info">
  817. <h6>Status</h6>
  818. <p>Loading playlist: {{ loadingPlaylist }}</p>
  819. <p>Loaded playlist: {{ loadedPlaylist }}</p>
  820. <p>
  821. Spotify songs in playlist:
  822. {{ spotifySongs.length }}
  823. </p>
  824. <p>Converting by {{ currentConvertType }}</p>
  825. <hr />
  826. <p>
  827. Loading Spotify tracks:
  828. {{ loadingSpotifyTracks }}
  829. </p>
  830. <p>
  831. Loaded Spotify tracks: {{ loadedSpotifyTracks }}
  832. </p>
  833. <p>
  834. Spotify tracks loaded:
  835. {{ Object.keys(spotifyTracks).length }}
  836. </p>
  837. <p>
  838. Loading Spotify albums:
  839. {{ loadingSpotifyAlbums }}
  840. </p>
  841. <p>
  842. Loaded Spotify albums: {{ loadedSpotifyAlbums }}
  843. </p>
  844. <p>
  845. Spotify albums:
  846. {{ Object.keys(spotifyAlbums).length }}
  847. </p>
  848. <p>
  849. Spotify artists:
  850. {{ Object.keys(spotifyArtists).length }}
  851. </p>
  852. <p>
  853. Getting missing alternative media:
  854. {{ gettingMissingAlternativeMedia }}
  855. </p>
  856. <p>
  857. Getting all alternative media per track:
  858. {{ gettingAllAlternativeMediaPerTrack }}
  859. </p>
  860. <p>
  861. Got all alternative media per track:
  862. {{ gotAllAlternativeMediaPerTrack }}
  863. </p>
  864. <hr />
  865. <p>
  866. Alternative media loaded:
  867. {{ Object.keys(alternativeMediaMap).length }}
  868. </p>
  869. <p>
  870. Alternative media that failed to load:
  871. {{
  872. Object.keys(alternativeMediaFailedMap)
  873. .length
  874. }}
  875. </p>
  876. <hr />
  877. <p>
  878. Replacing all Spotify songs:
  879. {{ replacingAllSpotifySongs }}
  880. </p>
  881. </div>
  882. </div>
  883. <br />
  884. <hr />
  885. <div
  886. class="convert-table convert-song-by-track"
  887. v-if="currentConvertType === 'track'"
  888. >
  889. <h4>Spotify songs</h4>
  890. <h4>Alternative songs</h4>
  891. <template
  892. v-for="spotifySong in filteredSpotifySongs"
  893. :key="spotifySong.mediaSource"
  894. >
  895. <div
  896. class="convert-table-cell convert-table-cell-left"
  897. >
  898. <song-item :song="spotifySong">
  899. <template #leftIcon>
  900. <a
  901. :href="`https://open.spotify.com/track/${
  902. spotifySong.mediaSource.split(
  903. ':'
  904. )[1]
  905. }`"
  906. target="_blank"
  907. >
  908. <div
  909. class="spotify-icon left-icon"
  910. ></div>
  911. </a>
  912. </template>
  913. </song-item>
  914. <template v-if="showExtra">
  915. <p>
  916. Media source:
  917. {{ spotifySong.mediaSource }}
  918. </p>
  919. <p v-if="loadedSpotifyTracks">
  920. ISRC:
  921. {{
  922. spotifyTracks[
  923. spotifySong.mediaSource
  924. ].externalIds.isrc
  925. }}
  926. </p>
  927. </template>
  928. <button
  929. v-if="showDontConvertButton"
  930. class="button is-primary is-fullwidth"
  931. @click="
  932. removeSpotifySong(
  933. spotifySong.mediaSource
  934. )
  935. "
  936. >
  937. Don't convert this song
  938. </button>
  939. </div>
  940. <div
  941. class="convert-table-cell convert-table-cell-right"
  942. >
  943. <p
  944. v-if="
  945. !alternativeMediaPerTrack[
  946. spotifySong.mediaSource
  947. ]
  948. "
  949. >
  950. Alternatives not loaded yet
  951. </p>
  952. <template v-else>
  953. <div class="alternative-media-items">
  954. <div
  955. class="alternative-media-item"
  956. :class="{
  957. 'selected-alternative-song':
  958. preferredAlternativeSongPerTrack[
  959. spotifySong.mediaSource
  960. ] ===
  961. alternativeMediaSource &&
  962. missingMediaSources.length ===
  963. 0
  964. }"
  965. v-for="alternativeMediaSource in alternativeMediaPerTrack[
  966. spotifySong.mediaSource
  967. ].mediaSources"
  968. :key="
  969. spotifySong.mediaSource +
  970. alternativeMediaSource
  971. "
  972. >
  973. <p
  974. v-if="
  975. alternativeMediaFailedMap[
  976. alternativeMediaSource
  977. ]
  978. "
  979. >
  980. Song
  981. {{ alternativeMediaSource }}
  982. failed to load
  983. </p>
  984. <p
  985. v-else-if="
  986. !alternativeMediaMap[
  987. alternativeMediaSource
  988. ]
  989. "
  990. >
  991. Song
  992. {{ alternativeMediaSource }}
  993. hasn't been loaded yet
  994. </p>
  995. <template v-else>
  996. <div
  997. class="alternative-song-container"
  998. >
  999. <song-item
  1000. :song="
  1001. alternativeMediaMap[
  1002. alternativeMediaSource
  1003. ]
  1004. "
  1005. >
  1006. <template #leftIcon>
  1007. <a
  1008. v-if="
  1009. alternativeMediaSource.split(
  1010. ':'
  1011. )[0] ===
  1012. 'youtube'
  1013. "
  1014. :href="`https://youtu.be/${
  1015. alternativeMediaSource.split(
  1016. ':'
  1017. )[1]
  1018. }`"
  1019. target="_blank"
  1020. >
  1021. <div
  1022. class="youtube-icon left-icon"
  1023. ></div>
  1024. </a>
  1025. <a
  1026. v-if="
  1027. alternativeMediaSource.split(
  1028. ':'
  1029. )[0] ===
  1030. 'soundcloud'
  1031. "
  1032. target="_blank"
  1033. >
  1034. <div
  1035. class="soundcloud-icon left-icon"
  1036. ></div>
  1037. </a>
  1038. </template>
  1039. </song-item>
  1040. <quick-confirm
  1041. v-if="
  1042. showReplaceButtonPerAlternative
  1043. "
  1044. placement="top"
  1045. @confirm="
  1046. replaceSpotifySong(
  1047. spotifySong.mediaSource,
  1048. alternativeMediaSource
  1049. )
  1050. "
  1051. >
  1052. <button
  1053. class="button is-primary is-fullwidth"
  1054. >
  1055. Use this alternative
  1056. </button>
  1057. </quick-confirm>
  1058. <button
  1059. v-if="
  1060. showDontConvertButton
  1061. "
  1062. class="button is-primary is-fullwidth"
  1063. @click="
  1064. removeAlternativeTrack(
  1065. spotifySong.mediaSource,
  1066. alternativeMediaSource
  1067. )
  1068. "
  1069. >
  1070. Remove this alternative
  1071. </button>
  1072. </div>
  1073. <ul v-if="showExtra">
  1074. <li
  1075. v-for="origin in alternativeMediaPerTrack[
  1076. spotifySong
  1077. .mediaSource
  1078. ].mediaSourcesOrigins[
  1079. alternativeMediaSource
  1080. ]"
  1081. :key="
  1082. spotifySong.mediaSource +
  1083. alternativeMediaSource +
  1084. origin
  1085. "
  1086. >
  1087. <hr />
  1088. <ul>
  1089. <li
  1090. v-for="originItem in origin"
  1091. :key="
  1092. spotifySong.mediaSource +
  1093. alternativeMediaSource +
  1094. origin +
  1095. originItem
  1096. "
  1097. >
  1098. +
  1099. {{ originItem }}
  1100. </li>
  1101. </ul>
  1102. </li>
  1103. </ul>
  1104. </template>
  1105. </div>
  1106. </div>
  1107. <p
  1108. v-if="
  1109. alternativeMediaPerTrack[
  1110. spotifySong.mediaSource
  1111. ].mediaSources.length === 0
  1112. "
  1113. >
  1114. No alternative media sources found
  1115. </p>
  1116. </template>
  1117. <div
  1118. v-if="
  1119. showReplacementInputs ||
  1120. (alternativeMediaPerTrack[
  1121. spotifySong.mediaSource
  1122. ] &&
  1123. alternativeMediaPerTrack[
  1124. spotifySong.mediaSource
  1125. ].mediaSources.length === 0)
  1126. "
  1127. >
  1128. <div>
  1129. <label class="label">
  1130. Enter replacement song from URL
  1131. </label>
  1132. <div
  1133. class="control is-grouped input-with-button"
  1134. >
  1135. <p class="control is-expanded">
  1136. <input
  1137. class="input"
  1138. type="text"
  1139. placeholder="Enter your song URL here..."
  1140. v-model="
  1141. replaceSongUrlMap[
  1142. spotifySong
  1143. .mediaSource
  1144. ]
  1145. "
  1146. @keyup.enter="
  1147. replaceSongFromUrl(
  1148. spotifySong.mediaSource
  1149. )
  1150. "
  1151. />
  1152. </p>
  1153. <p class="control">
  1154. <a
  1155. class="button is-info"
  1156. @click="
  1157. replaceSongFromUrl(
  1158. spotifySong.mediaSource
  1159. )
  1160. "
  1161. >Replace song</a
  1162. >
  1163. </p>
  1164. </div>
  1165. </div>
  1166. </div>
  1167. </div>
  1168. </template>
  1169. </div>
  1170. <div
  1171. class="convert-table convert-song-by-album"
  1172. v-if="currentConvertType === 'album'"
  1173. >
  1174. <h4>Spotify albums</h4>
  1175. <h4>Alternative songs</h4>
  1176. <template
  1177. v-for="spotifyAlbum in filteredSpotifyAlbums"
  1178. :key="spotifyAlbum"
  1179. >
  1180. <div
  1181. class="convert-table-cell convert-table-cell-left"
  1182. >
  1183. <p>Album ID: {{ spotifyAlbum.albumId }}</p>
  1184. <p v-if="loadingSpotifyAlbums">
  1185. Loading album info...
  1186. </p>
  1187. <p
  1188. v-else-if="
  1189. loadedSpotifyAlbums &&
  1190. !spotifyAlbum.rawData
  1191. "
  1192. >
  1193. Failed to load album info...
  1194. </p>
  1195. <template v-else-if="loadedSpotifyAlbums">
  1196. <p>Name: {{ spotifyAlbum.rawData.name }}</p>
  1197. <p>
  1198. Label: {{ spotifyAlbum.rawData.label }}
  1199. </p>
  1200. <p>
  1201. Popularity:
  1202. {{ spotifyAlbum.rawData.popularity }}
  1203. </p>
  1204. <p>
  1205. Release date:
  1206. {{ spotifyAlbum.rawData.release_date }}
  1207. </p>
  1208. <p>
  1209. Artists:
  1210. {{
  1211. spotifyAlbum.rawData.artists
  1212. .map(artist => artist.name)
  1213. .join(", ")
  1214. }}
  1215. </p>
  1216. <p>
  1217. UPC:
  1218. {{
  1219. spotifyAlbum.rawData.external_ids
  1220. .upc
  1221. }}
  1222. </p>
  1223. </template>
  1224. <song-item
  1225. v-for="spotifyMediaSource in spotifyAlbum.songs"
  1226. :key="
  1227. spotifyAlbum.albumId +
  1228. spotifyMediaSource
  1229. "
  1230. :song="{
  1231. title: spotifyTracks[spotifyMediaSource]
  1232. .name,
  1233. artists:
  1234. spotifyTracks[spotifyMediaSource]
  1235. .artists,
  1236. duration:
  1237. spotifyTracks[spotifyMediaSource]
  1238. .duration,
  1239. thumbnail:
  1240. spotifyTracks[spotifyMediaSource]
  1241. .albumImageUrl
  1242. }"
  1243. >
  1244. <template #leftIcon>
  1245. <a
  1246. :href="`https://open.spotify.com/track/${
  1247. spotifyMediaSource.split(':')[1]
  1248. }`"
  1249. target="_blank"
  1250. >
  1251. <div
  1252. class="spotify-icon left-icon"
  1253. ></div>
  1254. </a>
  1255. </template>
  1256. </song-item>
  1257. </div>
  1258. <div
  1259. class="convert-table-cell convert-table-cell-right"
  1260. >
  1261. <div
  1262. class="alternative-album-items"
  1263. v-if="
  1264. alternativeAlbumsPerAlbum[
  1265. spotifyAlbum.albumId
  1266. ]
  1267. "
  1268. >
  1269. <div
  1270. class="alternative-album-item"
  1271. v-for="youtubePlaylistId in alternativeAlbumsPerAlbum[
  1272. spotifyAlbum.albumId
  1273. ].youtubePlaylistIds"
  1274. :key="
  1275. spotifyAlbum.albumId +
  1276. youtubePlaylistId
  1277. "
  1278. >
  1279. <p>
  1280. YouTube Playlist
  1281. {{ youtubePlaylistId }} has been
  1282. automatically found
  1283. </p>
  1284. <button
  1285. class="button is-primary is-fullwidth"
  1286. >
  1287. Match songs using this playlist
  1288. </button>
  1289. </div>
  1290. </div>
  1291. </div>
  1292. </template>
  1293. </div>
  1294. </template>
  1295. </template>
  1296. </modal>
  1297. </div>
  1298. </template>
  1299. <style lang="less" scoped>
  1300. :deep(.song-item) {
  1301. .left-icon {
  1302. cursor: pointer;
  1303. }
  1304. }
  1305. .tracks {
  1306. display: flex;
  1307. flex-direction: column;
  1308. .track-row {
  1309. .left,
  1310. .right {
  1311. padding: 8px;
  1312. width: 50%;
  1313. box-shadow: inset 0px 0px 1px white;
  1314. display: flex;
  1315. flex-direction: column;
  1316. row-gap: 8px;
  1317. }
  1318. }
  1319. }
  1320. .alternative-media-items {
  1321. display: flex;
  1322. flex-direction: column;
  1323. row-gap: 12px;
  1324. }
  1325. .alternative-song-container,
  1326. .convert-table-cell-left {
  1327. display: flex;
  1328. flex-direction: column;
  1329. row-gap: 12px;
  1330. > * {
  1331. flex-grow: 0;
  1332. }
  1333. }
  1334. .convert-table {
  1335. display: grid;
  1336. grid-template-columns: 50% 50%;
  1337. gap: 1px;
  1338. .convert-table-cell {
  1339. outline: 1px solid white;
  1340. padding: 4px;
  1341. }
  1342. }
  1343. .selected-alternative-song {
  1344. // outline: 4px solid red;
  1345. border-left: 12px solid var(--primary-color);
  1346. padding: 4px;
  1347. }
  1348. .buttons-options-info-row {
  1349. display: grid;
  1350. grid-template-columns: 33.3% 33.3% 33.3%;
  1351. gap: 8px;
  1352. .buttons,
  1353. .options {
  1354. display: flex;
  1355. flex-direction: column;
  1356. row-gap: 8px;
  1357. > .control {
  1358. margin-bottom: 0 !important;
  1359. }
  1360. }
  1361. }
  1362. // .column-headers {
  1363. // display: flex;
  1364. // flex-direction: row;
  1365. // .column-header {
  1366. // flex: 1;
  1367. // }
  1368. // }
  1369. // .artists {
  1370. // display: flex;
  1371. // flex-direction: column;
  1372. // .artist-item {
  1373. // display: flex;
  1374. // flex-direction: column;
  1375. // row-gap: 8px;
  1376. // box-shadow: inset 0px 0px 1px white;
  1377. // width: 50%;
  1378. // position: relative;
  1379. // .spotify-section {
  1380. // display: flex;
  1381. // flex-direction: column;
  1382. // row-gap: 8px;
  1383. // padding: 8px 12px;
  1384. // .spotify-songs {
  1385. // display: flex;
  1386. // flex-direction: column;
  1387. // row-gap: 4px;
  1388. // }
  1389. // }
  1390. // .soundcloud-section {
  1391. // position: absolute;
  1392. // left: 100%;
  1393. // top: 0;
  1394. // width: 100%;
  1395. // height: 100%;
  1396. // overflow: hidden;
  1397. // box-shadow: inset 0px 0px 1px white;
  1398. // padding: 8px 12px;
  1399. // }
  1400. // }
  1401. // }
  1402. </style>