ImportAlbum.vue 24 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117
  1. <template>
  2. <div>
  3. <modal title="Import Album" class="import-album-modal">
  4. <template #body>
  5. <div class="tabs-container discogs-container">
  6. <div class="tab-selection">
  7. <button
  8. class="button is-default"
  9. :class="{ selected: discogsTab === 'search' }"
  10. ref="discogs-search-tab"
  11. @click="showDiscogsTab('search')"
  12. >
  13. Search
  14. </button>
  15. <button
  16. v-if="discogsAlbum && discogsAlbum.album"
  17. class="button is-default"
  18. :class="{ selected: discogsTab === 'selected' }"
  19. ref="discogs-selected-tab"
  20. @click="showDiscogsTab('selected')"
  21. >
  22. Selected
  23. </button>
  24. <button
  25. v-else
  26. class="button is-default"
  27. content="No album selected"
  28. v-tippy="{ theme: 'info' }"
  29. >
  30. Selected
  31. </button>
  32. </div>
  33. <div
  34. class="tab search-discogs-album"
  35. v-show="discogsTab === 'search'"
  36. >
  37. <p class="control is-expanded">
  38. <label class="label">Search query</label>
  39. <input
  40. class="input"
  41. type="text"
  42. ref="discogs-input"
  43. v-model="discogsQuery"
  44. @keyup.enter="searchDiscogsForPage(1)"
  45. @change="onDiscogsQueryChange"
  46. v-focus
  47. />
  48. </p>
  49. <button
  50. class="button is-fullwidth is-info"
  51. @click="searchDiscogsForPage(1)"
  52. >
  53. Search
  54. </button>
  55. <button
  56. class="button is-fullwidth is-danger"
  57. @click="clearDiscogsResults()"
  58. >
  59. Clear
  60. </button>
  61. <label
  62. class="label"
  63. v-if="discogs.apiResults.length > 0"
  64. >API results</label
  65. >
  66. <div
  67. class="api-results-container"
  68. v-if="discogs.apiResults.length > 0"
  69. >
  70. <div
  71. class="api-result"
  72. v-for="(result, index) in discogs.apiResults"
  73. :key="result.album.id"
  74. tabindex="0"
  75. @keydown.space.prevent
  76. @keyup.enter="toggleAPIResult(index)"
  77. >
  78. <div class="top-container">
  79. <img :src="result.album.albumArt" />
  80. <div class="right-container">
  81. <p class="album-title">
  82. {{ result.album.title }}
  83. </p>
  84. <div class="bottom-row">
  85. <img
  86. src="/assets/arrow_up.svg"
  87. v-if="result.expanded"
  88. @click="toggleAPIResult(index)"
  89. />
  90. <img
  91. src="/assets/arrow_down.svg"
  92. v-if="!result.expanded"
  93. @click="toggleAPIResult(index)"
  94. />
  95. <p class="type-year">
  96. <span>{{
  97. result.album.type
  98. }}</span>
  99. <span>{{
  100. result.album.year
  101. }}</span>
  102. </p>
  103. </div>
  104. </div>
  105. </div>
  106. <div
  107. class="bottom-container"
  108. v-if="result.expanded"
  109. >
  110. <p class="bottom-container-field">
  111. Artists:
  112. <span>{{
  113. result.album.artists.join(", ")
  114. }}</span>
  115. </p>
  116. <p class="bottom-container-field">
  117. Genres:
  118. <span>{{
  119. result.album.genres.join(", ")
  120. }}</span>
  121. </p>
  122. <p class="bottom-container-field">
  123. Data quality:
  124. <span>{{ result.dataQuality }}</span>
  125. </p>
  126. <button
  127. class="button is-primary"
  128. @click="selectAlbum(result)"
  129. >
  130. Import album
  131. </button>
  132. <div class="tracks">
  133. <div
  134. class="track"
  135. v-for="track in result.tracks"
  136. :key="`${track.position}-${track.title}`"
  137. >
  138. <span>{{ track.position }}.</span>
  139. <p>{{ track.title }}</p>
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. </div>
  145. <button
  146. v-if="
  147. discogs.apiResults.length > 0 &&
  148. !discogs.disableLoadMore &&
  149. discogs.page < discogs.pages
  150. "
  151. class="button is-fullwidth is-info discogs-load-more"
  152. @click="loadNextDiscogsPage()"
  153. >
  154. Load more...
  155. </button>
  156. </div>
  157. <div
  158. v-if="discogsAlbum && discogsAlbum.album"
  159. class="tab discogs-album"
  160. v-show="discogsTab === 'selected'"
  161. >
  162. <div class="top-container">
  163. <img :src="discogsAlbum.album.albumArt" />
  164. <div class="right-container">
  165. <p class="album-title">
  166. {{ discogsAlbum.album.title }}
  167. </p>
  168. <div class="bottom-row">
  169. <img
  170. src="/assets/arrow_up.svg"
  171. v-if="discogsAlbum.expanded"
  172. @click="toggleDiscogsAlbum()"
  173. />
  174. <img
  175. src="/assets/arrow_down.svg"
  176. v-if="!discogsAlbum.expanded"
  177. @click="toggleDiscogsAlbum()"
  178. />
  179. <p class="type-year">
  180. <span>{{
  181. discogsAlbum.album.type
  182. }}</span>
  183. <span>{{
  184. discogsAlbum.album.year
  185. }}</span>
  186. </p>
  187. </div>
  188. </div>
  189. </div>
  190. <div
  191. class="bottom-container"
  192. v-if="discogsAlbum.expanded"
  193. >
  194. <p class="bottom-container-field">
  195. Artists:
  196. <span>{{
  197. discogsAlbum.album.artists.join(", ")
  198. }}</span>
  199. </p>
  200. <p class="bottom-container-field">
  201. Genres:
  202. <span>{{
  203. discogsAlbum.album.genres.join(", ")
  204. }}</span>
  205. </p>
  206. <p class="bottom-container-field">
  207. Data quality:
  208. <span>{{ discogsAlbum.dataQuality }}</span>
  209. </p>
  210. <div class="tracks">
  211. <div
  212. class="track"
  213. tabindex="0"
  214. v-for="track in discogsAlbum.tracks"
  215. :key="`${track.position}-${track.title}`"
  216. >
  217. <span>{{ track.position }}.</span>
  218. <p>{{ track.title }}</p>
  219. </div>
  220. </div>
  221. </div>
  222. </div>
  223. </div>
  224. <div class="import-youtube-playlist">
  225. <p class="control is-expanded">
  226. <input
  227. class="input"
  228. type="text"
  229. placeholder="Enter YouTube Playlist URL here..."
  230. v-model="search.playlist.query"
  231. @keyup.enter="importPlaylist()"
  232. />
  233. </p>
  234. <button
  235. class="button is-fullwidth is-info"
  236. @click="importPlaylist()"
  237. >
  238. <i class="material-icons icon-with-button">publish</i
  239. >Import
  240. </button>
  241. <button
  242. class="button is-fullwidth is-danger"
  243. @click="resetTrackSongs()"
  244. >
  245. Reset
  246. </button>
  247. <draggable
  248. v-if="playlistSongs.length > 0"
  249. group="songs"
  250. v-model="playlistSongs"
  251. item-key="_id"
  252. @start="drag = true"
  253. @end="drag = false"
  254. @change="log"
  255. >
  256. <template #item="{ element }">
  257. <song-item
  258. :key="`playlist-song-${element._id}`"
  259. :song="element"
  260. >
  261. </song-item>
  262. </template>
  263. </draggable>
  264. </div>
  265. <div
  266. class="track-boxes"
  267. v-if="discogsAlbum && discogsAlbum.album"
  268. >
  269. <div
  270. class="track-box"
  271. v-for="(track, index) in discogsAlbum.tracks"
  272. :key="`${track.position}-${track.title}`"
  273. >
  274. <div class="track-position-title">
  275. <span>{{ track.position }}.</span>
  276. <p>{{ track.title }}</p>
  277. </div>
  278. <draggable
  279. class="track-box-songs-drag-area"
  280. group="songs"
  281. v-model="trackSongs[index]"
  282. item-key="_id"
  283. @start="drag = true"
  284. @end="drag = false"
  285. @change="log"
  286. >
  287. <template #item="{ element }">
  288. <song-item
  289. :key="`track-song-${element._id}`"
  290. :song="element"
  291. >
  292. </song-item>
  293. </template>
  294. </draggable>
  295. </div>
  296. </div>
  297. </template>
  298. <template #footer>
  299. <button class="button is-primary" @click="tryToAutoMove()">
  300. Try to auto move
  301. </button>
  302. <button class="button is-primary" @click="startEditingSongs()">
  303. Edit songs
  304. </button>
  305. <p class="is-expanded checkbox-control">
  306. <label class="switch">
  307. <input
  308. type="checkbox"
  309. id="prefill-discogs"
  310. v-model="localPrefillDiscogs"
  311. />
  312. <span class="slider round"></span>
  313. </label>
  314. <label for="prefill-discogs">
  315. <p>Prefill Discogs</p>
  316. </label>
  317. </p>
  318. </template>
  319. </modal>
  320. </div>
  321. </template>
  322. <script>
  323. import { mapState, mapGetters, mapActions } from "vuex";
  324. import draggable from "vuedraggable";
  325. import Toast from "toasters";
  326. import ws from "@/ws";
  327. import { mapModalState, mapModalActions } from "@/vuex_helpers";
  328. import SongItem from "../SongItem.vue";
  329. export default {
  330. components: { SongItem, draggable },
  331. props: {
  332. modalUuid: { type: String, default: "" }
  333. },
  334. data() {
  335. return {
  336. isImportingPlaylist: false,
  337. trackSongs: [],
  338. songsToEdit: [],
  339. // currentEditSongIndex: 0,
  340. search: {
  341. playlist: {
  342. query: ""
  343. }
  344. },
  345. discogsQuery: "",
  346. discogs: {
  347. apiResults: [],
  348. page: 1,
  349. pages: 1,
  350. disableLoadMore: false
  351. }
  352. };
  353. },
  354. computed: {
  355. playlistSongs: {
  356. get() {
  357. return this.$store.state.modals.importAlbum[this.modalUuid]
  358. .playlistSongs;
  359. },
  360. set(playlistSongs) {
  361. this.$store.commit(
  362. `modals/importAlbum/${this.modalUuid}/updatePlaylistSongs`,
  363. playlistSongs
  364. );
  365. }
  366. },
  367. localPrefillDiscogs: {
  368. get() {
  369. return this.$store.state.modals.importAlbum[this.modalUuid]
  370. .prefillDiscogs;
  371. },
  372. set(prefillDiscogs) {
  373. this.$store.commit(
  374. `modals/importAlbum/${this.modalUuid}/updatePrefillDiscogs`,
  375. prefillDiscogs
  376. );
  377. }
  378. },
  379. ...mapModalState("modals/importAlbum/MODAL_UUID", {
  380. discogsTab: state => state.discogsTab,
  381. discogsAlbum: state => state.discogsAlbum,
  382. editingSongs: state => state.editingSongs,
  383. prefillDiscogs: state => state.prefillDiscogs
  384. }),
  385. ...mapState("modalVisibility", {
  386. modals: state => state.modals
  387. }),
  388. ...mapGetters({
  389. socket: "websockets/getSocket"
  390. })
  391. },
  392. mounted() {
  393. ws.onConnect(this.init);
  394. this.socket.on("event:admin.song.updated", res => {
  395. this.updateTrackSong(res.data.song);
  396. });
  397. },
  398. beforeUnmount() {
  399. this.selectDiscogsAlbum({});
  400. this.setPlaylistSongs([]);
  401. this.showDiscogsTab("search");
  402. this.socket.dispatch("apis.leaveRoom", "import-album");
  403. // Delete the VueX module that was created for this modal, after all other cleanup tasks are performed
  404. this.$store.unregisterModule(["modals", "importAlbum", this.modalUuid]);
  405. },
  406. methods: {
  407. init() {
  408. this.socket.dispatch("apis.joinRoom", "import-album");
  409. },
  410. startEditingSongs() {
  411. this.songsToEdit = [];
  412. this.trackSongs.forEach((songs, index) => {
  413. songs.forEach(song => {
  414. const discogsAlbum = JSON.parse(
  415. JSON.stringify(this.discogsAlbum)
  416. );
  417. discogsAlbum.track = discogsAlbum.tracks[index];
  418. delete discogsAlbum.tracks;
  419. delete discogsAlbum.expanded;
  420. delete discogsAlbum.gotMoreInfo;
  421. const songToEdit = {
  422. songId: song._id,
  423. prefill: {
  424. discogs: discogsAlbum
  425. }
  426. };
  427. if (this.prefillDiscogs) {
  428. songToEdit.prefill.title = discogsAlbum.track.title;
  429. songToEdit.prefill.thumbnail =
  430. discogsAlbum.album.albumArt;
  431. songToEdit.prefill.genres = JSON.parse(
  432. JSON.stringify(discogsAlbum.album.genres)
  433. );
  434. songToEdit.prefill.artists = JSON.parse(
  435. JSON.stringify(discogsAlbum.album.artists)
  436. );
  437. }
  438. this.songsToEdit.push(songToEdit);
  439. });
  440. });
  441. if (this.songsToEdit.length === 0)
  442. new Toast("You can't edit 0 songs.");
  443. else {
  444. this.openModal({
  445. modal: "editSongs",
  446. data: { songs: this.songsToEdit }
  447. });
  448. }
  449. },
  450. log(evt) {
  451. window.console.log(evt);
  452. },
  453. importPlaylist() {
  454. if (this.isImportingPlaylist)
  455. return new Toast("A playlist is already importing.");
  456. this.isImportingPlaylist = true;
  457. // import query is blank
  458. if (!this.search.playlist.query)
  459. return new Toast("Please enter a YouTube playlist URL.");
  460. const regex = /[\\?&]list=([^&#]*)/;
  461. const splitQuery = regex.exec(this.search.playlist.query);
  462. if (!splitQuery) {
  463. return new Toast({
  464. content: "Please enter a valid YouTube playlist URL.",
  465. timeout: 4000
  466. });
  467. }
  468. // don't give starting import message instantly in case of instant error
  469. setTimeout(() => {
  470. if (this.isImportingPlaylist) {
  471. new Toast(
  472. "Starting to import your playlist. This can take some time to do."
  473. );
  474. }
  475. }, 750);
  476. return this.socket.dispatch(
  477. "songs.requestSet",
  478. this.search.playlist.query,
  479. false,
  480. true,
  481. res => {
  482. this.isImportingPlaylist = false;
  483. const songs = res.songs.filter(song => !song.verified);
  484. const songsAlreadyVerified =
  485. res.songs.length - songs.length;
  486. this.setPlaylistSongs(songs);
  487. if (this.discogsAlbum.tracks) {
  488. this.trackSongs = this.discogsAlbum.tracks.map(
  489. () => []
  490. );
  491. this.tryToAutoMove();
  492. }
  493. if (songsAlreadyVerified > 0)
  494. new Toast(
  495. `${songsAlreadyVerified} songs were already verified, skipping those.`
  496. );
  497. return new Toast({ content: res.message, timeout: 20000 });
  498. }
  499. );
  500. },
  501. tryToAutoMove() {
  502. const { tracks } = this.discogsAlbum;
  503. const { trackSongs } = this;
  504. const playlistSongs = JSON.parse(
  505. JSON.stringify(this.playlistSongs)
  506. );
  507. tracks.forEach((track, index) => {
  508. playlistSongs.forEach(playlistSong => {
  509. if (
  510. playlistSong.title
  511. .toLowerCase()
  512. .trim()
  513. .indexOf(track.title.toLowerCase().trim()) !== -1
  514. ) {
  515. playlistSongs.splice(
  516. playlistSongs.indexOf(playlistSong),
  517. 1
  518. );
  519. trackSongs[index].push(playlistSong);
  520. }
  521. });
  522. });
  523. this.updatePlaylistSongs(playlistSongs);
  524. },
  525. resetTrackSongs() {
  526. this.resetPlaylistSongs();
  527. this.trackSongs = this.discogsAlbum.tracks.map(() => []);
  528. },
  529. selectAlbum(result) {
  530. this.selectDiscogsAlbum(result);
  531. this.trackSongs = this.discogsAlbum.tracks.map(() => []);
  532. if (this.playlistSongs.length > 0) this.tryToAutoMove();
  533. // this.clearDiscogsResults();
  534. this.showDiscogsTab("selected");
  535. },
  536. toggleAPIResult(index) {
  537. const apiResult = this.discogs.apiResults[index];
  538. if (apiResult.expanded === true) apiResult.expanded = false;
  539. else if (apiResult.gotMoreInfo === true) apiResult.expanded = true;
  540. else {
  541. fetch(apiResult.album.resourceUrl)
  542. .then(response => response.json())
  543. .then(data => {
  544. apiResult.album.artists = [];
  545. apiResult.album.artistIds = [];
  546. const artistRegex = /\\([0-9]+\\)$/;
  547. apiResult.dataQuality = data.data_quality;
  548. data.artists.forEach(artist => {
  549. apiResult.album.artists.push(
  550. artist.name.replace(artistRegex, "")
  551. );
  552. apiResult.album.artistIds.push(artist.id);
  553. });
  554. apiResult.tracks = data.tracklist.map(track => ({
  555. position: track.position,
  556. title: track.title
  557. }));
  558. apiResult.expanded = true;
  559. apiResult.gotMoreInfo = true;
  560. });
  561. }
  562. },
  563. clearDiscogsResults() {
  564. this.discogs.apiResults = [];
  565. this.discogs.page = 1;
  566. this.discogs.pages = 1;
  567. this.discogs.disableLoadMore = false;
  568. },
  569. searchDiscogsForPage(page) {
  570. const query = this.discogsQuery;
  571. this.socket.dispatch("apis.searchDiscogs", query, page, res => {
  572. if (res.status === "success") {
  573. if (page === 1)
  574. new Toast(
  575. `Successfully searched. Got ${res.data.results.length} results.`
  576. );
  577. else
  578. new Toast(
  579. `Successfully got ${res.data.results.length} more results.`
  580. );
  581. if (page === 1) {
  582. this.discogs.apiResults = [];
  583. }
  584. this.discogs.pages = res.data.pages;
  585. this.discogs.apiResults = this.discogs.apiResults.concat(
  586. res.data.results.map(result => {
  587. const type =
  588. result.type.charAt(0).toUpperCase() +
  589. result.type.slice(1);
  590. return {
  591. expanded: false,
  592. gotMoreInfo: false,
  593. album: {
  594. id: result.id,
  595. title: result.title,
  596. type,
  597. year: result.year,
  598. genres: result.genre,
  599. albumArt: result.cover_image,
  600. resourceUrl: result.resource_url
  601. }
  602. };
  603. })
  604. );
  605. this.discogs.page = page;
  606. this.discogs.disableLoadMore = false;
  607. } else new Toast(res.message);
  608. });
  609. },
  610. loadNextDiscogsPage() {
  611. this.discogs.disableLoadMore = true;
  612. this.searchDiscogsForPage(this.discogs.page + 1);
  613. },
  614. onDiscogsQueryChange() {
  615. this.discogs.page = 1;
  616. this.discogs.pages = 1;
  617. this.discogs.apiResults = [];
  618. this.discogs.disableLoadMore = false;
  619. },
  620. updateTrackSong(updatedSong) {
  621. this.updatePlaylistSong(updatedSong);
  622. this.trackSongs.forEach((songs, indexA) => {
  623. songs.forEach((song, indexB) => {
  624. if (song._id === updatedSong._id)
  625. this.trackSongs[indexA][indexB] = updatedSong;
  626. });
  627. });
  628. },
  629. ...mapActions({
  630. showDiscogsTab(dispatch, payload) {
  631. if (this.$refs[`discogs-${payload}-tab`])
  632. this.$refs[`discogs-${payload}-tab`].scrollIntoView({
  633. block: "nearest"
  634. });
  635. return dispatch(
  636. `modals/importAlbum/${this.modalUuid}/showDiscogsTab`,
  637. payload
  638. );
  639. }
  640. }),
  641. ...mapModalActions("modals/importAlbum/MODAL_UUID", [
  642. "toggleDiscogsAlbum",
  643. "setPlaylistSongs",
  644. "updatePlaylistSongs",
  645. "selectDiscogsAlbum",
  646. "updateEditingSongs",
  647. "resetPlaylistSongs",
  648. "togglePrefillDiscogs",
  649. "updatePlaylistSong"
  650. ]),
  651. ...mapActions("modals/editSongs", ["editSongs"]),
  652. ...mapActions("modalVisibility", ["closeModal", "openModal"])
  653. }
  654. };
  655. </script>
  656. <style lang="less">
  657. .night-mode {
  658. .search-discogs-album,
  659. .discogs-album,
  660. .import-youtube-playlist,
  661. .track-boxes,
  662. #tabs-container {
  663. background-color: var(--dark-grey-3) !important;
  664. border: 0 !important;
  665. .tab {
  666. border: 0 !important;
  667. }
  668. }
  669. #tabs-container #tab-selection .button {
  670. background: var(--dark-grey) !important;
  671. color: var(--white) !important;
  672. }
  673. .api-result {
  674. background-color: var(--dark-grey-3) !important;
  675. }
  676. .api-result .tracks .track:hover,
  677. .api-result .tracks .track:focus,
  678. .discogs-album .tracks .track:hover,
  679. .discogs-album .tracks .track:focus {
  680. background-color: var(--dark-grey-2) !important;
  681. }
  682. .api-result .bottom-row img,
  683. .discogs-album .bottom-row img {
  684. filter: invert(100%);
  685. }
  686. .label,
  687. p,
  688. strong {
  689. color: var(--light-grey-2);
  690. }
  691. }
  692. .import-album-modal {
  693. .modal-card-title {
  694. text-align: center;
  695. margin-left: 24px;
  696. }
  697. .modal-card {
  698. width: 100%;
  699. height: 100%;
  700. .modal-card-body {
  701. padding: 16px;
  702. display: flex;
  703. flex-direction: row;
  704. flex-wrap: wrap;
  705. justify-content: space-evenly;
  706. }
  707. .modal-card-foot {
  708. .button {
  709. margin: 0;
  710. &:not(:first-of-type) {
  711. margin-left: 5px;
  712. }
  713. }
  714. div div {
  715. margin-right: 5px;
  716. }
  717. .right {
  718. display: flex;
  719. margin-left: auto;
  720. margin-right: 0;
  721. }
  722. }
  723. }
  724. }
  725. </style>
  726. <style lang="less" scoped>
  727. .break {
  728. flex-basis: 100%;
  729. height: 0;
  730. border: 1px solid var(--dark-grey);
  731. margin-top: 16px;
  732. margin-bottom: 16px;
  733. }
  734. .tabs-container {
  735. max-width: 376px;
  736. height: 100%;
  737. display: flex;
  738. flex-direction: column;
  739. flex-grow: 1;
  740. .tab-selection {
  741. display: flex;
  742. overflow-x: auto;
  743. .button {
  744. border-radius: @border-radius @border-radius 0 0;
  745. border: 0;
  746. text-transform: uppercase;
  747. font-size: 14px;
  748. color: var(--dark-grey-3);
  749. background-color: var(--light-grey-2);
  750. flex-grow: 1;
  751. height: 32px;
  752. &:not(:first-of-type) {
  753. margin-left: 5px;
  754. }
  755. }
  756. .selected {
  757. background-color: var(--primary-color) !important;
  758. color: var(--white) !important;
  759. font-weight: 600;
  760. }
  761. }
  762. .tab {
  763. border: 1px solid var(--light-grey-3);
  764. border-radius: 0 0 @border-radius @border-radius;
  765. padding: 15px;
  766. height: calc(100% - 32px);
  767. overflow: auto;
  768. }
  769. }
  770. .tabs-container.discogs-container {
  771. --primary-color: var(--purple);
  772. .search-discogs-album {
  773. background-color: var(--light-grey);
  774. border: 1px rgba(143, 40, 140, 0.75) solid;
  775. > label {
  776. margin-top: 12px;
  777. }
  778. .top-container {
  779. display: flex;
  780. img {
  781. height: 85px;
  782. width: 85px;
  783. }
  784. .right-container {
  785. padding: 8px;
  786. display: flex;
  787. flex-direction: column;
  788. flex: 1;
  789. .album-title {
  790. flex: 1;
  791. font-weight: 600;
  792. }
  793. .bottom-row {
  794. display: flex;
  795. flex-flow: row;
  796. line-height: 15px;
  797. img {
  798. height: 15px;
  799. align-self: end;
  800. flex: 1;
  801. user-select: none;
  802. -moz-user-select: none;
  803. -ms-user-select: none;
  804. -webkit-user-select: none;
  805. cursor: pointer;
  806. }
  807. p {
  808. text-align: right;
  809. }
  810. .type-year {
  811. font-size: 13px;
  812. align-self: end;
  813. }
  814. }
  815. }
  816. }
  817. .bottom-container {
  818. padding: 12px;
  819. .bottom-container-field {
  820. line-height: 16px;
  821. margin-bottom: 8px;
  822. font-weight: 600;
  823. span {
  824. font-weight: 400;
  825. }
  826. }
  827. .bottom-container-field:last-of-type {
  828. margin-bottom: 8px;
  829. }
  830. }
  831. .api-result {
  832. background-color: var(--white);
  833. border: 0.5px solid var(--primary-color);
  834. border-radius: @border-radius;
  835. margin-bottom: 16px;
  836. }
  837. button {
  838. margin: 5px 0;
  839. &:focus,
  840. &:hover {
  841. filter: contrast(0.75);
  842. }
  843. }
  844. .tracks {
  845. margin-top: 12px;
  846. .track:first-child {
  847. margin-top: 0;
  848. border-radius: @border-radius @border-radius 0 0;
  849. }
  850. .track:last-child {
  851. border-radius: 0 0 @border-radius @border-radius;
  852. }
  853. .track {
  854. border: 0.5px solid var(--black);
  855. margin-top: -1px;
  856. line-height: 16px;
  857. display: flex;
  858. span {
  859. font-weight: 600;
  860. display: inline-block;
  861. margin-top: 7px;
  862. margin-bottom: 7px;
  863. margin-left: 7px;
  864. }
  865. p {
  866. display: inline-block;
  867. margin: 7px;
  868. flex: 1;
  869. }
  870. }
  871. }
  872. .discogs-load-more {
  873. margin-bottom: 8px;
  874. }
  875. }
  876. .discogs-album {
  877. background-color: var(--light-grey);
  878. border: 1px rgba(143, 40, 140, 0.75) solid;
  879. .top-container {
  880. display: flex;
  881. img {
  882. height: 85px;
  883. width: 85px;
  884. }
  885. .right-container {
  886. padding: 8px;
  887. display: flex;
  888. flex-direction: column;
  889. flex: 1;
  890. .album-title {
  891. flex: 1;
  892. font-weight: 600;
  893. }
  894. .bottom-row {
  895. display: flex;
  896. flex-flow: row;
  897. line-height: 15px;
  898. img {
  899. height: 15px;
  900. align-self: end;
  901. flex: 1;
  902. user-select: none;
  903. -moz-user-select: none;
  904. -ms-user-select: none;
  905. -webkit-user-select: none;
  906. cursor: pointer;
  907. }
  908. p {
  909. text-align: right;
  910. }
  911. .type-year {
  912. font-size: 13px;
  913. align-self: end;
  914. }
  915. }
  916. }
  917. }
  918. .bottom-container {
  919. padding: 12px;
  920. .bottom-container-field {
  921. line-height: 16px;
  922. margin-bottom: 8px;
  923. font-weight: 600;
  924. span {
  925. font-weight: 400;
  926. }
  927. }
  928. .bottom-container-field:last-of-type {
  929. margin-bottom: 0;
  930. }
  931. .tracks {
  932. margin-top: 12px;
  933. .track:first-child {
  934. margin-top: 0;
  935. border-radius: @border-radius @border-radius 0 0;
  936. }
  937. .track:last-child {
  938. border-radius: 0 0 @border-radius @border-radius;
  939. }
  940. .track {
  941. border: 0.5px solid var(--black);
  942. margin-top: -1px;
  943. line-height: 16px;
  944. display: flex;
  945. span {
  946. font-weight: 600;
  947. display: inline-block;
  948. margin-top: 7px;
  949. margin-bottom: 7px;
  950. margin-left: 7px;
  951. }
  952. p {
  953. display: inline-block;
  954. margin: 7px;
  955. flex: 1;
  956. }
  957. }
  958. .track:hover,
  959. .track:focus {
  960. background-color: var(--light-grey);
  961. }
  962. }
  963. }
  964. }
  965. }
  966. .import-youtube-playlist {
  967. width: 376px;
  968. background-color: var(--light-grey);
  969. border: 1px rgba(163, 224, 255, 0.75) solid;
  970. border-radius: @border-radius;
  971. padding: 16px;
  972. overflow: auto;
  973. height: 100%;
  974. button {
  975. margin: 5px 0;
  976. }
  977. }
  978. .track-boxes {
  979. width: 376px;
  980. background-color: var(--light-grey);
  981. border: 1px rgba(163, 224, 255, 0.75) solid;
  982. border-radius: @border-radius;
  983. padding: 16px;
  984. overflow: auto;
  985. height: 100%;
  986. .track-box:first-child {
  987. margin-top: 0;
  988. border-radius: @border-radius @border-radius 0 0;
  989. }
  990. .track-box:last-child {
  991. border-radius: 0 0 @border-radius @border-radius;
  992. }
  993. .track-box {
  994. border: 0.5px solid var(--black);
  995. margin-top: -1px;
  996. line-height: 16px;
  997. display: flex;
  998. flex-flow: column;
  999. .track-position-title {
  1000. display: flex;
  1001. span {
  1002. font-weight: 600;
  1003. display: inline-block;
  1004. margin-top: 7px;
  1005. margin-bottom: 7px;
  1006. margin-left: 7px;
  1007. }
  1008. p {
  1009. display: inline-block;
  1010. margin: 7px;
  1011. flex: 1;
  1012. }
  1013. }
  1014. .track-box-songs-drag-area {
  1015. flex: 1;
  1016. min-height: 100px;
  1017. }
  1018. }
  1019. }
  1020. </style>