ImportAlbum.vue 24 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115
  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.editSongs(this.songsToEdit);
  445. this.openModal("editSongs");
  446. }
  447. },
  448. log(evt) {
  449. window.console.log(evt);
  450. },
  451. importPlaylist() {
  452. if (this.isImportingPlaylist)
  453. return new Toast("A playlist is already importing.");
  454. this.isImportingPlaylist = true;
  455. // import query is blank
  456. if (!this.search.playlist.query)
  457. return new Toast("Please enter a YouTube playlist URL.");
  458. const regex = /[\\?&]list=([^&#]*)/;
  459. const splitQuery = regex.exec(this.search.playlist.query);
  460. if (!splitQuery) {
  461. return new Toast({
  462. content: "Please enter a valid YouTube playlist URL.",
  463. timeout: 4000
  464. });
  465. }
  466. // don't give starting import message instantly in case of instant error
  467. setTimeout(() => {
  468. if (this.isImportingPlaylist) {
  469. new Toast(
  470. "Starting to import your playlist. This can take some time to do."
  471. );
  472. }
  473. }, 750);
  474. return this.socket.dispatch(
  475. "songs.requestSet",
  476. this.search.playlist.query,
  477. false,
  478. true,
  479. res => {
  480. this.isImportingPlaylist = false;
  481. const songs = res.songs.filter(song => !song.verified);
  482. const songsAlreadyVerified =
  483. res.songs.length - songs.length;
  484. this.setPlaylistSongs(songs);
  485. if (this.discogsAlbum.tracks) {
  486. this.trackSongs = this.discogsAlbum.tracks.map(
  487. () => []
  488. );
  489. this.tryToAutoMove();
  490. }
  491. if (songsAlreadyVerified > 0)
  492. new Toast(
  493. `${songsAlreadyVerified} songs were already verified, skipping those.`
  494. );
  495. return new Toast({ content: res.message, timeout: 20000 });
  496. }
  497. );
  498. },
  499. tryToAutoMove() {
  500. const { tracks } = this.discogsAlbum;
  501. const { trackSongs } = this;
  502. const playlistSongs = JSON.parse(
  503. JSON.stringify(this.playlistSongs)
  504. );
  505. tracks.forEach((track, index) => {
  506. playlistSongs.forEach(playlistSong => {
  507. if (
  508. playlistSong.title
  509. .toLowerCase()
  510. .trim()
  511. .indexOf(track.title.toLowerCase().trim()) !== -1
  512. ) {
  513. playlistSongs.splice(
  514. playlistSongs.indexOf(playlistSong),
  515. 1
  516. );
  517. trackSongs[index].push(playlistSong);
  518. }
  519. });
  520. });
  521. this.updatePlaylistSongs(playlistSongs);
  522. },
  523. resetTrackSongs() {
  524. this.resetPlaylistSongs();
  525. this.trackSongs = this.discogsAlbum.tracks.map(() => []);
  526. },
  527. selectAlbum(result) {
  528. this.selectDiscogsAlbum(result);
  529. this.trackSongs = this.discogsAlbum.tracks.map(() => []);
  530. if (this.playlistSongs.length > 0) this.tryToAutoMove();
  531. // this.clearDiscogsResults();
  532. this.showDiscogsTab("selected");
  533. },
  534. toggleAPIResult(index) {
  535. const apiResult = this.discogs.apiResults[index];
  536. if (apiResult.expanded === true) apiResult.expanded = false;
  537. else if (apiResult.gotMoreInfo === true) apiResult.expanded = true;
  538. else {
  539. fetch(apiResult.album.resourceUrl)
  540. .then(response => response.json())
  541. .then(data => {
  542. apiResult.album.artists = [];
  543. apiResult.album.artistIds = [];
  544. const artistRegex = /\\([0-9]+\\)$/;
  545. apiResult.dataQuality = data.data_quality;
  546. data.artists.forEach(artist => {
  547. apiResult.album.artists.push(
  548. artist.name.replace(artistRegex, "")
  549. );
  550. apiResult.album.artistIds.push(artist.id);
  551. });
  552. apiResult.tracks = data.tracklist.map(track => ({
  553. position: track.position,
  554. title: track.title
  555. }));
  556. apiResult.expanded = true;
  557. apiResult.gotMoreInfo = true;
  558. });
  559. }
  560. },
  561. clearDiscogsResults() {
  562. this.discogs.apiResults = [];
  563. this.discogs.page = 1;
  564. this.discogs.pages = 1;
  565. this.discogs.disableLoadMore = false;
  566. },
  567. searchDiscogsForPage(page) {
  568. const query = this.discogsQuery;
  569. this.socket.dispatch("apis.searchDiscogs", query, page, res => {
  570. if (res.status === "success") {
  571. if (page === 1)
  572. new Toast(
  573. `Successfully searched. Got ${res.data.results.length} results.`
  574. );
  575. else
  576. new Toast(
  577. `Successfully got ${res.data.results.length} more results.`
  578. );
  579. if (page === 1) {
  580. this.discogs.apiResults = [];
  581. }
  582. this.discogs.pages = res.data.pages;
  583. this.discogs.apiResults = this.discogs.apiResults.concat(
  584. res.data.results.map(result => {
  585. const type =
  586. result.type.charAt(0).toUpperCase() +
  587. result.type.slice(1);
  588. return {
  589. expanded: false,
  590. gotMoreInfo: false,
  591. album: {
  592. id: result.id,
  593. title: result.title,
  594. type,
  595. year: result.year,
  596. genres: result.genre,
  597. albumArt: result.cover_image,
  598. resourceUrl: result.resource_url
  599. }
  600. };
  601. })
  602. );
  603. this.discogs.page = page;
  604. this.discogs.disableLoadMore = false;
  605. } else new Toast(res.message);
  606. });
  607. },
  608. loadNextDiscogsPage() {
  609. this.discogs.disableLoadMore = true;
  610. this.searchDiscogsForPage(this.discogs.page + 1);
  611. },
  612. onDiscogsQueryChange() {
  613. this.discogs.page = 1;
  614. this.discogs.pages = 1;
  615. this.discogs.apiResults = [];
  616. this.discogs.disableLoadMore = false;
  617. },
  618. updateTrackSong(updatedSong) {
  619. this.updatePlaylistSong(updatedSong);
  620. this.trackSongs.forEach((songs, indexA) => {
  621. songs.forEach((song, indexB) => {
  622. if (song._id === updatedSong._id)
  623. this.trackSongs[indexA][indexB] = updatedSong;
  624. });
  625. });
  626. },
  627. ...mapActions({
  628. showDiscogsTab(dispatch, payload) {
  629. if (this.$refs[`discogs-${payload}-tab`])
  630. this.$refs[`discogs-${payload}-tab`].scrollIntoView({
  631. block: "nearest"
  632. });
  633. return dispatch(
  634. `modals/importAlbum/${this.modalUuid}/showDiscogsTab`,
  635. payload
  636. );
  637. }
  638. }),
  639. ...mapModalActions("modals/importAlbum/MODAL_UUID", [
  640. "toggleDiscogsAlbum",
  641. "setPlaylistSongs",
  642. "updatePlaylistSongs",
  643. "selectDiscogsAlbum",
  644. "updateEditingSongs",
  645. "resetPlaylistSongs",
  646. "togglePrefillDiscogs",
  647. "updatePlaylistSong"
  648. ]),
  649. ...mapActions("modals/editSongs", ["editSongs"]),
  650. ...mapActions("modalVisibility", ["closeModal", "openModal"])
  651. }
  652. };
  653. </script>
  654. <style lang="less">
  655. .night-mode {
  656. .search-discogs-album,
  657. .discogs-album,
  658. .import-youtube-playlist,
  659. .track-boxes,
  660. #tabs-container {
  661. background-color: var(--dark-grey-3) !important;
  662. border: 0 !important;
  663. .tab {
  664. border: 0 !important;
  665. }
  666. }
  667. #tabs-container #tab-selection .button {
  668. background: var(--dark-grey) !important;
  669. color: var(--white) !important;
  670. }
  671. .api-result {
  672. background-color: var(--dark-grey-3) !important;
  673. }
  674. .api-result .tracks .track:hover,
  675. .api-result .tracks .track:focus,
  676. .discogs-album .tracks .track:hover,
  677. .discogs-album .tracks .track:focus {
  678. background-color: var(--dark-grey-2) !important;
  679. }
  680. .api-result .bottom-row img,
  681. .discogs-album .bottom-row img {
  682. filter: invert(100%);
  683. }
  684. .label,
  685. p,
  686. strong {
  687. color: var(--light-grey-2);
  688. }
  689. }
  690. .import-album-modal {
  691. .modal-card-title {
  692. text-align: center;
  693. margin-left: 24px;
  694. }
  695. .modal-card {
  696. width: 100%;
  697. height: 100%;
  698. .modal-card-body {
  699. padding: 16px;
  700. display: flex;
  701. flex-direction: row;
  702. flex-wrap: wrap;
  703. justify-content: space-evenly;
  704. }
  705. .modal-card-foot {
  706. .button {
  707. margin: 0;
  708. &:not(:first-of-type) {
  709. margin-left: 5px;
  710. }
  711. }
  712. div div {
  713. margin-right: 5px;
  714. }
  715. .right {
  716. display: flex;
  717. margin-left: auto;
  718. margin-right: 0;
  719. }
  720. }
  721. }
  722. }
  723. </style>
  724. <style lang="less" scoped>
  725. .break {
  726. flex-basis: 100%;
  727. height: 0;
  728. border: 1px solid var(--dark-grey);
  729. margin-top: 16px;
  730. margin-bottom: 16px;
  731. }
  732. .tabs-container {
  733. max-width: 376px;
  734. height: 100%;
  735. display: flex;
  736. flex-direction: column;
  737. flex-grow: 1;
  738. .tab-selection {
  739. display: flex;
  740. overflow-x: auto;
  741. .button {
  742. border-radius: @border-radius @border-radius 0 0;
  743. border: 0;
  744. text-transform: uppercase;
  745. font-size: 14px;
  746. color: var(--dark-grey-3);
  747. background-color: var(--light-grey-2);
  748. flex-grow: 1;
  749. height: 32px;
  750. &:not(:first-of-type) {
  751. margin-left: 5px;
  752. }
  753. }
  754. .selected {
  755. background-color: var(--primary-color) !important;
  756. color: var(--white) !important;
  757. font-weight: 600;
  758. }
  759. }
  760. .tab {
  761. border: 1px solid var(--light-grey-3);
  762. border-radius: 0 0 @border-radius @border-radius;
  763. padding: 15px;
  764. height: calc(100% - 32px);
  765. overflow: auto;
  766. }
  767. }
  768. .tabs-container.discogs-container {
  769. --primary-color: var(--purple);
  770. .search-discogs-album {
  771. background-color: var(--light-grey);
  772. border: 1px rgba(143, 40, 140, 0.75) solid;
  773. > label {
  774. margin-top: 12px;
  775. }
  776. .top-container {
  777. display: flex;
  778. img {
  779. height: 85px;
  780. width: 85px;
  781. }
  782. .right-container {
  783. padding: 8px;
  784. display: flex;
  785. flex-direction: column;
  786. flex: 1;
  787. .album-title {
  788. flex: 1;
  789. font-weight: 600;
  790. }
  791. .bottom-row {
  792. display: flex;
  793. flex-flow: row;
  794. line-height: 15px;
  795. img {
  796. height: 15px;
  797. align-self: end;
  798. flex: 1;
  799. user-select: none;
  800. -moz-user-select: none;
  801. -ms-user-select: none;
  802. -webkit-user-select: none;
  803. cursor: pointer;
  804. }
  805. p {
  806. text-align: right;
  807. }
  808. .type-year {
  809. font-size: 13px;
  810. align-self: end;
  811. }
  812. }
  813. }
  814. }
  815. .bottom-container {
  816. padding: 12px;
  817. .bottom-container-field {
  818. line-height: 16px;
  819. margin-bottom: 8px;
  820. font-weight: 600;
  821. span {
  822. font-weight: 400;
  823. }
  824. }
  825. .bottom-container-field:last-of-type {
  826. margin-bottom: 8px;
  827. }
  828. }
  829. .api-result {
  830. background-color: var(--white);
  831. border: 0.5px solid var(--primary-color);
  832. border-radius: @border-radius;
  833. margin-bottom: 16px;
  834. }
  835. button {
  836. margin: 5px 0;
  837. &:focus,
  838. &:hover {
  839. filter: contrast(0.75);
  840. }
  841. }
  842. .tracks {
  843. margin-top: 12px;
  844. .track:first-child {
  845. margin-top: 0;
  846. border-radius: @border-radius @border-radius 0 0;
  847. }
  848. .track:last-child {
  849. border-radius: 0 0 @border-radius @border-radius;
  850. }
  851. .track {
  852. border: 0.5px solid var(--black);
  853. margin-top: -1px;
  854. line-height: 16px;
  855. display: flex;
  856. span {
  857. font-weight: 600;
  858. display: inline-block;
  859. margin-top: 7px;
  860. margin-bottom: 7px;
  861. margin-left: 7px;
  862. }
  863. p {
  864. display: inline-block;
  865. margin: 7px;
  866. flex: 1;
  867. }
  868. }
  869. }
  870. .discogs-load-more {
  871. margin-bottom: 8px;
  872. }
  873. }
  874. .discogs-album {
  875. background-color: var(--light-grey);
  876. border: 1px rgba(143, 40, 140, 0.75) solid;
  877. .top-container {
  878. display: flex;
  879. img {
  880. height: 85px;
  881. width: 85px;
  882. }
  883. .right-container {
  884. padding: 8px;
  885. display: flex;
  886. flex-direction: column;
  887. flex: 1;
  888. .album-title {
  889. flex: 1;
  890. font-weight: 600;
  891. }
  892. .bottom-row {
  893. display: flex;
  894. flex-flow: row;
  895. line-height: 15px;
  896. img {
  897. height: 15px;
  898. align-self: end;
  899. flex: 1;
  900. user-select: none;
  901. -moz-user-select: none;
  902. -ms-user-select: none;
  903. -webkit-user-select: none;
  904. cursor: pointer;
  905. }
  906. p {
  907. text-align: right;
  908. }
  909. .type-year {
  910. font-size: 13px;
  911. align-self: end;
  912. }
  913. }
  914. }
  915. }
  916. .bottom-container {
  917. padding: 12px;
  918. .bottom-container-field {
  919. line-height: 16px;
  920. margin-bottom: 8px;
  921. font-weight: 600;
  922. span {
  923. font-weight: 400;
  924. }
  925. }
  926. .bottom-container-field:last-of-type {
  927. margin-bottom: 0;
  928. }
  929. .tracks {
  930. margin-top: 12px;
  931. .track:first-child {
  932. margin-top: 0;
  933. border-radius: @border-radius @border-radius 0 0;
  934. }
  935. .track:last-child {
  936. border-radius: 0 0 @border-radius @border-radius;
  937. }
  938. .track {
  939. border: 0.5px solid var(--black);
  940. margin-top: -1px;
  941. line-height: 16px;
  942. display: flex;
  943. span {
  944. font-weight: 600;
  945. display: inline-block;
  946. margin-top: 7px;
  947. margin-bottom: 7px;
  948. margin-left: 7px;
  949. }
  950. p {
  951. display: inline-block;
  952. margin: 7px;
  953. flex: 1;
  954. }
  955. }
  956. .track:hover,
  957. .track:focus {
  958. background-color: var(--light-grey);
  959. }
  960. }
  961. }
  962. }
  963. }
  964. .import-youtube-playlist {
  965. width: 376px;
  966. background-color: var(--light-grey);
  967. border: 1px rgba(163, 224, 255, 0.75) solid;
  968. border-radius: @border-radius;
  969. padding: 16px;
  970. overflow: auto;
  971. height: 100%;
  972. button {
  973. margin: 5px 0;
  974. }
  975. }
  976. .track-boxes {
  977. width: 376px;
  978. background-color: var(--light-grey);
  979. border: 1px rgba(163, 224, 255, 0.75) solid;
  980. border-radius: @border-radius;
  981. padding: 16px;
  982. overflow: auto;
  983. height: 100%;
  984. .track-box:first-child {
  985. margin-top: 0;
  986. border-radius: @border-radius @border-radius 0 0;
  987. }
  988. .track-box:last-child {
  989. border-radius: 0 0 @border-radius @border-radius;
  990. }
  991. .track-box {
  992. border: 0.5px solid var(--black);
  993. margin-top: -1px;
  994. line-height: 16px;
  995. display: flex;
  996. flex-flow: column;
  997. .track-position-title {
  998. display: flex;
  999. span {
  1000. font-weight: 600;
  1001. display: inline-block;
  1002. margin-top: 7px;
  1003. margin-bottom: 7px;
  1004. margin-left: 7px;
  1005. }
  1006. p {
  1007. display: inline-block;
  1008. margin: 7px;
  1009. flex: 1;
  1010. }
  1011. }
  1012. .track-box-songs-drag-area {
  1013. flex: 1;
  1014. min-height: 100px;
  1015. }
  1016. }
  1017. }
  1018. </style>