ImportAlbum.vue 24 KB

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