Fix and add Locales. Add Reverse playlist functionality

This commit is contained in:
Preston 2020-09-09 18:58:35 -04:00
parent 61d0f78a5a
commit dea4eba109
12 changed files with 57 additions and 15 deletions

View File

@ -422,7 +422,7 @@ export default Vue.extend({
}
this.showToast({
message: this.$t('Settings.Data Settings.All subscriptions have been successfully exported')
message: this.$t('Settings.Data Settings.Subscriptions have been successfully exported')
})
})
})
@ -489,7 +489,7 @@ export default Vue.extend({
}
this.showToast({
message: this.$t('Settings.Data Settings.All subscriptions have been successfully exported')
message: this.$t('Settings.Data Settings.Subscriptions have been successfully exported')
})
})
})
@ -557,7 +557,7 @@ export default Vue.extend({
}
this.showToast({
message: this.$t('Settings.Data Settings.All subscriptions have been successfully exported')
message: this.$t('Settings.Data Settings.Subscriptions have been successfully exported')
})
})
})

View File

@ -19,7 +19,7 @@
@click="importHistory"
/>
<ft-button
:label="$t('Settings.Data Settings.Export Subscriptions')"
:label="$t('Settings.Data Settings.Export History')"
@click="exportHistory"
/>
</ft-flex-box>

View File

@ -18,7 +18,7 @@
<h3
class="profileListTitle"
>
Profile Select
{{ $t("Profile.Profile Select") }}
</h3>
<ft-icon-button
class="profileSettings"

View File

@ -28,6 +28,7 @@ export default Vue.extend({
isLoading: false,
shuffleEnabled: false,
loopEnabled: false,
reversePlaylist: false,
channelName: '',
channelId: '',
channelThumbnail: '',
@ -132,6 +133,19 @@ export default Vue.extend({
}
},
toggleReversePlaylist: function () {
this.isLoading = true
this.showToast({
message: this.$t('The playlist has been reversed')
})
this.reversePlaylist = !this.reversePlaylist
this.playlistItems = this.playlistItems.reverse()
setTimeout(() => {
this.isLoading = false
}, 1)
},
playNextVideo: function () {
const playlistInfo = {
playlistId: this.playlistId

View File

@ -28,22 +28,33 @@
class="playlistIcon"
:class="{ playlistIconActive: loopEnabled }"
icon="retweet"
:title="$t('Video.Loop Playlist')"
@click="toggleLoop"
/>
<font-awesome-icon
class="playlistIcon"
:class="{ playlistIconActive: shuffleEnabled }"
icon="random"
:title="$t('Video.Shuffle Playlist')"
@click="toggleShuffle"
/>
<font-awesome-icon
class="playlistIcon"
:class="{ playlistIconActive: reversePlaylist }"
icon="exchange-alt"
:title="$t('Video.Reverse Playlist')"
@click="toggleReversePlaylist"
/>
<font-awesome-icon
class="playlistIcon"
icon="step-backward"
:title="$t('Video.Play Previous Video')"
@click="playPreviousVideo"
/>
<font-awesome-icon
class="playlistIcon"
icon="step-forward"
:title="$t('Video.Play Next Video')"
@click="playNextVideo"
/>
</p>

View File

@ -16,7 +16,7 @@ export default Vue.extend({
type: Array,
required: true
},
watchingPlaylist: {
showAutoplay: {
type: Boolean,
default: false
}

View File

@ -4,7 +4,7 @@
{{ $t("Up Next") }}
</h3>
<ft-toggle-switch
v-if="!watchingPlaylist"
v-if="showAutoplay"
class="autoPlayToggle"
:label="$t('Video.Autoplay')"
:compact="true"

View File

@ -23,7 +23,7 @@ Vue.component('font-awesome-icon', FontAwesomeIcon)
Vue.use(VueI18n)
// List of locales approved for use
const activeLocales = ['en-US', 'de-DE', 'es-MX', 'fi', 'fr-FR', 'ja', 'pt-BR', 'pt-PT', 'ru', 'vi', 'zh-CN', 'zh-TW']
const activeLocales = ['en-US', 'de-DE', 'es-MX', 'fi', 'fr-FR', 'ja', 'pt-BR', 'pt-PT', 'pl', 'ru', 'vi', 'zh-CN', 'zh-TW']
const messages = {}
const fileLocation = isDev ? 'static/locales/' : `${__dirname}/static/locales/`

View File

@ -258,17 +258,25 @@ export default Vue.extend({
const feedUrl = `https://www.youtube.com/feeds/videos.xml?channel_id=${channelId}`
parser.parseURL(feedUrl).then(async (feed) => {
resolve(await Promise.all(feed.items.map((video) => {
const items = await Promise.all(feed.items.map((video) => {
video.authorId = channelId
video.videoId = video.id.replace('yt:video:', '')
video.type = 'video'
video.publishedDate = new Date(video.pubDate)
video.publishedText = video.publishedDate.toLocaleString()
video.lengthSeconds = '0:00'
video.isRSS = true
video.publishedDate = new Date(video.pubDate)
if (video.publishedDate.toString() === 'Invalid Date') {
video.publishedDate = new Date(video.isoDate)
}
video.publishedText = video.publishedDate.toLocaleString()
return video
})))
}))
resolve(items)
}).catch((err) => {
console.log(err)
const errorMessage = this.$t('Local API Error (Click to copy)')

View File

@ -303,8 +303,10 @@ export default Vue.extend({
this.activeSourceList = this.videoSourceList
}
const templateUrl = result.player_response.storyboards.playerStoryboardSpecRenderer.spec
this.createLocalStoryboardUrls(templateUrl)
if (typeof result.player_response.storyboards !== 'undefined') {
const templateUrl = result.player_response.storyboards.playerStoryboardSpecRenderer.spec
this.createLocalStoryboardUrls(templateUrl)
}
}
this.isLoading = false

View File

@ -80,7 +80,7 @@
/>
<watch-video-recommendations
v-if="!isLoading"
:watching-playlist="watchingPlaylist"
:show-autoplay="!watchingPlaylist"
:data="recommendedVideos"
class="watchVideoSideBar watchVideoRecommendations"
:class="{

View File

@ -271,6 +271,7 @@ About:
Latest FreeTube News: Latest FreeTube News
Profile:
Profile Select: Profile Select
All Channels: All Channels
Profile Manager: Profile Manager
Create New Profile: Create New Profile
@ -335,6 +336,11 @@ Video:
Copy Invidious Link: Copy Invidious Link
View: View
Views: Views
Loop Playlist: Loop Playlist
Shuffle Playlist: Shuffle Playlist
Reverse Playlist: Reverse Playlist
Play Next Video: Play Next Video
Play Previous Video: Play Previous Video
# Context is "X People Watching"
Watching: Watching
Watched: Watched
@ -454,6 +460,7 @@ Loop is now disabled: Loop is now disabled
Loop is now enabled: Loop is now enabled
Shuffle is now disabled: Shuffle is now disabled
Shuffle is now enabled: Shuffle is now enabled
The playlist has been reversed: The playlist has been reversed
Playing Next Video: Playing Next Video
Playing Previous Video: Playing Previous Video
Playing next video in 5 seconds. Click to cancel: Playing next video in 5 seconds. Click