Fixed issues with spotify playlists and added localization compatibility
This commit is contained in:
		
							parent
							
								
									6fecc5fde0
								
							
						
					
					
						commit
						57691329b3
					
				
										
											
												File diff suppressed because one or more lines are too long
											
										
									
								
							@ -167,8 +167,8 @@ export default {
 | 
			
		||||
			this.sortKey = 'release_date'
 | 
			
		||||
			this.sortOrder = 'desc'
 | 
			
		||||
			this.head = [
 | 
			
		||||
				{ title: 'Title', sortKey: 'title' },
 | 
			
		||||
				{ title: 'Release Date', sortKey: 'release_date' },
 | 
			
		||||
				{ title: this.$tc('globals.listTabs.title',1), sortKey: 'title' },
 | 
			
		||||
				{ title: this.$t('globals.listTabs.releaseDate'), sortKey: 'release_date' },
 | 
			
		||||
				{ title: '', width: '32px' }
 | 
			
		||||
			]
 | 
			
		||||
			if (isEmpty(releases)) {
 | 
			
		||||
 | 
			
		||||
@ -49,7 +49,7 @@
 | 
			
		||||
					<p class="primary-text">{{ release.title }}</p>
 | 
			
		||||
					<p class="secondary-text">
 | 
			
		||||
						{{
 | 
			
		||||
							`${$t('globals.by')} ${release.creator.name} - ${release.nb_tracks} ${$tc('globals.listTabs.track', 2)}`
 | 
			
		||||
							`${$t('globals.by', [release.creator.name])} - ${$tc('globals.listTabs.trackN', release.nb_tracks)}`
 | 
			
		||||
						}}
 | 
			
		||||
					</p>
 | 
			
		||||
				</div>
 | 
			
		||||
@ -75,9 +75,9 @@
 | 
			
		||||
					<p class="primary-text">{{ release.title }}</p>
 | 
			
		||||
					<p class="secondary-text">
 | 
			
		||||
						{{
 | 
			
		||||
							`${$t('globals.by')} ${release.creator.name} - ${release.nb_tracks.name} ${$tc(
 | 
			
		||||
								'globals.listTabs.track',
 | 
			
		||||
								2
 | 
			
		||||
							`${$t('globals.by', [release.creator.name])} - ${$tc(
 | 
			
		||||
								'globals.listTabs.trackN',
 | 
			
		||||
								release.nb_tracks
 | 
			
		||||
							)}`
 | 
			
		||||
						}}
 | 
			
		||||
					</p>
 | 
			
		||||
@ -104,7 +104,7 @@
 | 
			
		||||
						</div>
 | 
			
		||||
					</div>
 | 
			
		||||
					<p class="primary-text">{{ release.title }}</p>
 | 
			
		||||
					<p class="secondary-text">{{ `${$t('globals.by')} ${release.artist.name}` }}</p>
 | 
			
		||||
					<p class="secondary-text">{{ `${$t('globals.by', [release.artist.name])}` }}</p>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</div>
 | 
			
		||||
 | 
			
		||||
@ -30,7 +30,7 @@
 | 
			
		||||
					</div>
 | 
			
		||||
					<p class="primary-text">{{ release.title }}</p>
 | 
			
		||||
					<p class="secondary-text">
 | 
			
		||||
						{{ `${$t('globals.by')} ${release.user.name} - ${release.nb_tracks} ${$tc('globals.listTabs.track', 2)}` }}
 | 
			
		||||
						{{ `${$t('globals.by', [release.user.name])} - ${$tc('globals.listTabs.trackN', release.nb_tracks)}` }}
 | 
			
		||||
					</p>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
@ -59,7 +59,7 @@
 | 
			
		||||
						</div>
 | 
			
		||||
					</div>
 | 
			
		||||
					<p class="primary-text">{{ release.title }}</p>
 | 
			
		||||
					<p class="secondary-text">{{ `${$t('globals.by')} ${release.artist.name}` }}</p>
 | 
			
		||||
					<p class="secondary-text">{{ `${$t('globals.by', [release.artist.name])}` }}</p>
 | 
			
		||||
				</div>
 | 
			
		||||
			</div>
 | 
			
		||||
		</section>
 | 
			
		||||
 | 
			
		||||
@ -24,15 +24,19 @@
 | 
			
		||||
				<div>
 | 
			
		||||
					<h1>{{ title }}</h1>
 | 
			
		||||
					<h2 v-if="type == 'track'">
 | 
			
		||||
						{{ $t('globals.by') }}
 | 
			
		||||
						<span class="clickable" @click="artistView" :data-id="data.artist.id">{{ data.artist.name }}</span>
 | 
			
		||||
						{{ ` • ${$t('globals.in')}` }}
 | 
			
		||||
						<span class="clickable" @click="albumView" :data-id="data.album.id">{{ data.album.title }}</span>
 | 
			
		||||
						<i18n path="globals.by" tag="span">
 | 
			
		||||
							<span place="0" class="clickable" @click="artistView" :data-id="data.artist.id">{{ data.artist.name }}</span>
 | 
			
		||||
						</i18n>
 | 
			
		||||
						 •
 | 
			
		||||
						<i18n path="globals.in" tag="span">
 | 
			
		||||
							<span place="0" class="clickable" @click="albumView" :data-id="data.album.id">{{ data.album.title }}</span>
 | 
			
		||||
						</i18n>
 | 
			
		||||
					</h2>
 | 
			
		||||
					<h2 v-else-if="type == 'album'">
 | 
			
		||||
						{{ $t('globals.by') }}
 | 
			
		||||
						<span class="clickable" @click="artistView" :data-id="data.artist.id">{{ data.artist.name }}</span>
 | 
			
		||||
						{{ ` • ${data.nb_tracks}  ${$tc('globals.listTabs.track', 2)}` }}
 | 
			
		||||
						<i18n path="globals.by" tag="span">
 | 
			
		||||
							<span place="0" class="clickable" @click="artistView" :data-id="data.artist.id">{{ data.artist.name }}</span>
 | 
			
		||||
						</i18n>
 | 
			
		||||
						{{ ` • ${$tc('globals.listTabs.trackN', data.nb_tracks)}` }}
 | 
			
		||||
					</h2>
 | 
			
		||||
				</div>
 | 
			
		||||
				<div
 | 
			
		||||
 | 
			
		||||
@ -429,7 +429,7 @@
 | 
			
		||||
							<p class="primary-text">{{ release.title }}</p>
 | 
			
		||||
							<p class="secondary-text">
 | 
			
		||||
								{{
 | 
			
		||||
									`${$t('globals.by')} ${release.user.name} - ${release.nb_tracks} ${$tc('globals.listTabs.track', 2)}`
 | 
			
		||||
									`${$t('globals.by', [release.user.name])} - ${$tc('globals.listTabs.trackN', release.nb_tracks)}`
 | 
			
		||||
								}}
 | 
			
		||||
							</p>
 | 
			
		||||
						</div>
 | 
			
		||||
 | 
			
		||||
@ -1,17 +1,17 @@
 | 
			
		||||
<template>
 | 
			
		||||
	<div id="modal_quality" class="smallmodal" v-show="open" @click="tryToDownloadTrack($event)" ref="modal">
 | 
			
		||||
		<div class="smallmodal-content">
 | 
			
		||||
			<button class="quality-button" data-quality-value="9">{{ $t('globals.download') }} FLAC</button>
 | 
			
		||||
			<button class="quality-button" data-quality-value="3">{{ $t('globals.download') }} MP3 320kbps</button>
 | 
			
		||||
			<button class="quality-button" data-quality-value="1">{{ $t('globals.download') }} MP3 128kbps</button>
 | 
			
		||||
			<button class="quality-button" data-quality-value="9">{{ $t('globals.download', ['FLAC']) }}</button>
 | 
			
		||||
			<button class="quality-button" data-quality-value="3">{{ $t('globals.download', ['MP3 320kbps']) }}</button>
 | 
			
		||||
			<button class="quality-button" data-quality-value="1">{{ $t('globals.download', ['MP3 128kbps']) }}</button>
 | 
			
		||||
			<button class="quality-button" data-quality-value="15">
 | 
			
		||||
				{{ $t('globals.download') }} 360 Reality Audio [HQ]
 | 
			
		||||
				{{ $t('globals.download', ['360 Reality Audio [HQ]']) }}
 | 
			
		||||
			</button>
 | 
			
		||||
			<button class="quality-button" data-quality-value="14">
 | 
			
		||||
				{{ $t('globals.download') }} 360 Reality Audio [MQ]
 | 
			
		||||
				{{ $t('globals.download', ['360 Reality Audio [MQ]']) }}
 | 
			
		||||
			</button>
 | 
			
		||||
			<button class="quality-button" data-quality-value="13">
 | 
			
		||||
				{{ $t('globals.download') }} 360 Reality Audio [LQ]
 | 
			
		||||
				{{ $t('globals.download', ['360 Reality Audio [LQ]']) }}
 | 
			
		||||
			</button>
 | 
			
		||||
		</div>
 | 
			
		||||
	</div>
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,9 @@
 | 
			
		||||
 | 
			
		||||
		<div id="logged_in_info" ref="loggedInInfo">
 | 
			
		||||
			<img id="settings_picture" src="" alt="Profile Picture" ref="userpicture" class="circle" />
 | 
			
		||||
			<p>{{ $t('settings.login.loggedIn') }} <strong id="settings_username" ref="username"></strong></p>
 | 
			
		||||
			<i18n path="settings.login.loggedIn" tag="p">
 | 
			
		||||
				<strong place="username" id="settings_username" ref="username"></strong>
 | 
			
		||||
			</i18n>
 | 
			
		||||
			<button id="settings_btn_logout" @click="logout">{{ $t('settings.login.logout') }}</button>
 | 
			
		||||
			<select v-if="accounts.length" id="family_account" v-model="accountNum" @change="changeAccount">
 | 
			
		||||
				<option v-for="(account, i) in accounts" :value="i.toString()">{{ account.BLOG_NAME }}</option>
 | 
			
		||||
 | 
			
		||||
@ -24,7 +24,7 @@
 | 
			
		||||
					<th>#</th>
 | 
			
		||||
					<th>{{ $tc('globals.listTabs.track', 1) }}</th>
 | 
			
		||||
					<th>{{ $tc('globals.listTabs.artist', 1) }}</th>
 | 
			
		||||
					<th v-if="type === 'Playlist'">{{ $tc('globals.listTabs.album', 1) }}</th>
 | 
			
		||||
					<th v-if="type === 'playlist'">{{ $tc('globals.listTabs.album', 1) }}</th>
 | 
			
		||||
					<th>
 | 
			
		||||
						<i class="material-icons">timer</i>
 | 
			
		||||
					</th>
 | 
			
		||||
@ -34,7 +34,7 @@
 | 
			
		||||
				</tr>
 | 
			
		||||
			</thead>
 | 
			
		||||
			<tbody>
 | 
			
		||||
				<template v-if="type !== 'Spotify Playlist'">
 | 
			
		||||
				<template v-if="type !== 'spotifyPlaylist'">
 | 
			
		||||
					<template v-for="track in body">
 | 
			
		||||
						<tr v-if="track.type == 'track'">
 | 
			
		||||
							<td class="table__cell--x-small table__cell--center">
 | 
			
		||||
@ -50,7 +50,7 @@
 | 
			
		||||
								</div>
 | 
			
		||||
							</td>
 | 
			
		||||
							<td class="table__cell--small table__cell--center track_position">
 | 
			
		||||
								{{ type === 'Album' ? track.track_position : body.indexOf(track) + 1 }}
 | 
			
		||||
								{{ type === 'album' ? track.track_position : body.indexOf(track) + 1 }}
 | 
			
		||||
							</td>
 | 
			
		||||
							<td class="table__cell--large table__cell--with-icon">
 | 
			
		||||
								<div class="table__cell-content table__cell-content--vertical-center">
 | 
			
		||||
@ -73,7 +73,7 @@
 | 
			
		||||
								{{ track.artist.name }}
 | 
			
		||||
							</td>
 | 
			
		||||
							<td
 | 
			
		||||
								v-if="type == 'Playlist'"
 | 
			
		||||
								v-if="type == 'playlist'"
 | 
			
		||||
								class="table__cell--medium table__cell--center clickable"
 | 
			
		||||
								@click="albumView"
 | 
			
		||||
								:data-id="track.album.id"
 | 
			
		||||
@ -82,7 +82,7 @@
 | 
			
		||||
							</td>
 | 
			
		||||
							<td
 | 
			
		||||
								class="table__cell--center"
 | 
			
		||||
								:class="{ 'table__cell--small': type === 'Album', 'table__cell--x-small': type === 'Playlist' }"
 | 
			
		||||
								:class="{ 'table__cell--small': type === 'album', 'table__cell--x-small': type === 'playlist' }"
 | 
			
		||||
							>
 | 
			
		||||
								{{ convertDuration(track.duration) }}
 | 
			
		||||
							</td>
 | 
			
		||||
@ -132,7 +132,7 @@
 | 
			
		||||
		<span v-if="label" style="opacity: 0.40;margin-top: 8px;display: inline-block;font-size: 13px;">{{ label }}</span>
 | 
			
		||||
		<footer>
 | 
			
		||||
			<button @contextmenu.prevent="openQualityModal" @click.stop="addToQueue" :data-link="link">
 | 
			
		||||
				{{ `${$t('globals.download')} ${$tc(`globals.listTabs.${type}`, 1)}` }}
 | 
			
		||||
				{{ `${$t('globals.download', [$tc(`globals.listTabs.${type}`, 1)])}` }}
 | 
			
		||||
			</button>
 | 
			
		||||
			<button
 | 
			
		||||
				class="with_icon"
 | 
			
		||||
@ -202,7 +202,7 @@ export default {
 | 
			
		||||
			if (this.body) {
 | 
			
		||||
				this.body.forEach(item => {
 | 
			
		||||
					if (item.type == 'track' && item.selected)
 | 
			
		||||
						selected.push(this.type == 'Spotify Playlist' ? item.uri : item.link)
 | 
			
		||||
						selected.push(this.type == 'spotifyPlaylist' ? item.uri : item.link)
 | 
			
		||||
				})
 | 
			
		||||
			}
 | 
			
		||||
			return selected.join(';')
 | 
			
		||||
@ -221,12 +221,12 @@ export default {
 | 
			
		||||
				cover_xl
 | 
			
		||||
			} = data
 | 
			
		||||
 | 
			
		||||
			this.type = `${this.$tc('globals.listTabs.album', 1)}`
 | 
			
		||||
			this.type = 'album'
 | 
			
		||||
			this.link = `https://www.deezer.com/album/${albumID}`
 | 
			
		||||
			this.title = albumTitle
 | 
			
		||||
			this.explicit = explicit_lyrics
 | 
			
		||||
			this.label = albumLabel
 | 
			
		||||
			this.metadata = `${artistName} • ${numberOfTracks} ${this.$tc('globals.listTabs.track', 2)}`
 | 
			
		||||
			this.metadata = `${artistName} • ${this.$tc('globals.listTabs.trackN', numberOfTracks)}`
 | 
			
		||||
			this.release_date = release_date.substring(0, 10)
 | 
			
		||||
			this.image = cover_xl
 | 
			
		||||
 | 
			
		||||
@ -247,15 +247,12 @@ export default {
 | 
			
		||||
				tracks: { length: numberOfTracks }
 | 
			
		||||
			} = data
 | 
			
		||||
 | 
			
		||||
			this.type = `${this.$tc('globals.listTabs.playlist', 1)}`
 | 
			
		||||
			this.type = 'playlist'
 | 
			
		||||
			this.link = `https://www.deezer.com/playlist/${playlistID}`
 | 
			
		||||
			this.title = playlistTitle
 | 
			
		||||
			this.image = playlistCover
 | 
			
		||||
			this.release_date = creation_date.substring(0, 10)
 | 
			
		||||
			this.metadata = `${this.$t('globals.by')} ${creatorName} • ${numberOfTracks} ${this.$tc(
 | 
			
		||||
				'globals.listTabs.track',
 | 
			
		||||
				2
 | 
			
		||||
			)}`
 | 
			
		||||
			this.metadata = `${this.$t('globals.by', [creatorName])} • ${this.$tc('globals.listTabs.trackN', numberOfTracks)}`
 | 
			
		||||
 | 
			
		||||
			if (isEmpty(playlistTracks)) {
 | 
			
		||||
				this.body = null
 | 
			
		||||
@ -274,17 +271,14 @@ export default {
 | 
			
		||||
				tracks: { length: numberOfTracks }
 | 
			
		||||
			} = data
 | 
			
		||||
 | 
			
		||||
			this.type = `${this.$tc('globals.listTabs.spotifyPlaylist', 1)}`
 | 
			
		||||
			this.type = 'spotifyPlaylist'
 | 
			
		||||
			this.link = playlistURI
 | 
			
		||||
			this.title = playlistName
 | 
			
		||||
			this.image = numberOfImages
 | 
			
		||||
				? images[0].url
 | 
			
		||||
				: 'https://e-cdns-images.dzcdn.net/images/cover/d41d8cd98f00b204e9800998ecf8427e/1000x1000-000000-80-0-0.jpg'
 | 
			
		||||
			this.release_date = ''
 | 
			
		||||
			this.metadata = `${this.$t('globals.by')} ${ownerName} • ${numberOfTracks} ${this.$tc(
 | 
			
		||||
				'globals.listTabs.track',
 | 
			
		||||
				2
 | 
			
		||||
			)}`
 | 
			
		||||
			this.metadata = `${this.$t('globals.by', [ownerName])} • ${this.$tc('globals.listTabs.trackN', numberOfTracks)}`
 | 
			
		||||
 | 
			
		||||
			if (isEmpty(playlistTracks)) {
 | 
			
		||||
				this.body = null
 | 
			
		||||
 | 
			
		||||
@ -3,9 +3,9 @@ const en = {
 | 
			
		||||
		welcome: 'Welcome to deemix',
 | 
			
		||||
		back: 'back',
 | 
			
		||||
		loading: 'loading',
 | 
			
		||||
		download: 'Download',
 | 
			
		||||
		by: 'by',
 | 
			
		||||
		in: 'in',
 | 
			
		||||
		download: 'Download {0}',
 | 
			
		||||
		by: 'by {0}',
 | 
			
		||||
		in: 'in {0}',
 | 
			
		||||
		listTabs: {
 | 
			
		||||
			empty: '',
 | 
			
		||||
			all: 'all',
 | 
			
		||||
@ -14,9 +14,10 @@ const en = {
 | 
			
		||||
			single: 'single | singles',
 | 
			
		||||
			title: 'title | titles',
 | 
			
		||||
			track: 'track | tracks',
 | 
			
		||||
			trackN: '0 tracks | {n} track | {n} tracks',
 | 
			
		||||
			playlist: 'playlist | playlists',
 | 
			
		||||
			compile: 'compilations',
 | 
			
		||||
			ep: 'eps',
 | 
			
		||||
			compile: 'compilation | compilations',
 | 
			
		||||
			ep: 'ep | eps',
 | 
			
		||||
			spotifyPlaylist: 'spotify playlist | spotify playlists',
 | 
			
		||||
			releaseDate: 'release date',
 | 
			
		||||
			error: 'error'
 | 
			
		||||
@ -77,7 +78,7 @@ const en = {
 | 
			
		||||
		languages: 'Languages',
 | 
			
		||||
		login: {
 | 
			
		||||
			title: 'Login',
 | 
			
		||||
			loggedIn: 'You are logged in as',
 | 
			
		||||
			loggedIn: 'You are logged in as {username}',
 | 
			
		||||
			arl: {
 | 
			
		||||
				question: 'How do I get my own ARL?',
 | 
			
		||||
				update: 'Update ARL'
 | 
			
		||||
 | 
			
		||||
@ -3,9 +3,9 @@ const it = {
 | 
			
		||||
		welcome: 'Benvenuto su deemix',
 | 
			
		||||
		back: 'indietro',
 | 
			
		||||
		loading: 'caricamento',
 | 
			
		||||
		download: 'Scarica',
 | 
			
		||||
		by: 'di',
 | 
			
		||||
		in: 'in',
 | 
			
		||||
		download: 'Scarica {0}',
 | 
			
		||||
		by: 'di {0}',
 | 
			
		||||
		in: 'in {0}',
 | 
			
		||||
		listTabs: {
 | 
			
		||||
			all: 'tutto',
 | 
			
		||||
			album: 'album',
 | 
			
		||||
@ -13,6 +13,7 @@ const it = {
 | 
			
		||||
			single: 'singolo | singoli',
 | 
			
		||||
			title: 'titolo | titoli',
 | 
			
		||||
			track: 'traccia | tracce',
 | 
			
		||||
			trackN: '0 tracce | {n} traccia | {n} tracce',
 | 
			
		||||
			playlist: 'playlist',
 | 
			
		||||
			compile: 'compilation',
 | 
			
		||||
			ep: 'ep',
 | 
			
		||||
@ -73,7 +74,7 @@ const it = {
 | 
			
		||||
		languages: 'Lingue',
 | 
			
		||||
		login: {
 | 
			
		||||
			title: 'Login',
 | 
			
		||||
			loggedIn: 'Sei loggato come',
 | 
			
		||||
			loggedIn: 'Sei loggato come {username}',
 | 
			
		||||
			arl: {
 | 
			
		||||
				question: 'Come ottengo il mio ARL?',
 | 
			
		||||
				update: 'Aggiorna ARL'
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user