mirror of
https://github.com/TeamPiped/Piped.git
synced 2024-08-14 23:57:27 +00:00
parent
dcf6e672a9
commit
c1a2aef8e3
1 changed files with 26 additions and 0 deletions
|
@ -6,6 +6,15 @@
|
|||
<br />
|
||||
<router-link to="/subscriptions" class="uk-text-center">View Subscriptions</router-link>
|
||||
|
||||
<br />
|
||||
Sort by:
|
||||
<select class="uk-select uk-width-auto" v-model="selectedSort" @change="onChange()">
|
||||
<option value="descending">Most Recent</option>
|
||||
<option value="ascending">Least Recent</option>
|
||||
<option value="channel_ascending">Channel Name (A-Z)</option>
|
||||
<option value="channel_descending">Channel Name (Z-A)</option>
|
||||
</select>
|
||||
|
||||
<div class="uk-align-right">
|
||||
<a :href="getRssUrl"><font-awesome-icon icon="rss"></font-awesome-icon></a>
|
||||
</div>
|
||||
|
@ -31,6 +40,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
videos: [],
|
||||
selectedSort: "descending",
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
|
@ -45,6 +55,22 @@ export default {
|
|||
authToken: this.getAuthToken(),
|
||||
});
|
||||
},
|
||||
onChange() {
|
||||
switch (this.selectedSort) {
|
||||
case "ascending":
|
||||
this.videos.sort((a, b) => a.uploaded - b.uploaded);
|
||||
break;
|
||||
case "descending":
|
||||
this.videos.sort((a, b) => b.uploaded - a.uploaded);
|
||||
break;
|
||||
case "channel_ascending":
|
||||
this.videos.sort((a, b) => a.uploaderName.localeCompare(b.uploaderName));
|
||||
break;
|
||||
case "channel_descending":
|
||||
this.videos.sort((a, b) => b.uploaderName.localeCompare(a.uploaderName));
|
||||
break;
|
||||
}
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
getRssUrl(_this) {
|
||||
|
|
Loading…
Reference in a new issue