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 />
 | 
					    <br />
 | 
				
			||||||
    <router-link to="/subscriptions" class="uk-text-center">View Subscriptions</router-link>
 | 
					    <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">
 | 
					    <div class="uk-align-right">
 | 
				
			||||||
        <a :href="getRssUrl"><font-awesome-icon icon="rss"></font-awesome-icon></a>
 | 
					        <a :href="getRssUrl"><font-awesome-icon icon="rss"></font-awesome-icon></a>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
| 
						 | 
					@ -31,6 +40,7 @@ export default {
 | 
				
			||||||
    data() {
 | 
					    data() {
 | 
				
			||||||
        return {
 | 
					        return {
 | 
				
			||||||
            videos: [],
 | 
					            videos: [],
 | 
				
			||||||
 | 
					            selectedSort: "descending",
 | 
				
			||||||
        };
 | 
					        };
 | 
				
			||||||
    },
 | 
					    },
 | 
				
			||||||
    mounted() {
 | 
					    mounted() {
 | 
				
			||||||
| 
						 | 
					@ -45,6 +55,22 @@ export default {
 | 
				
			||||||
                authToken: this.getAuthToken(),
 | 
					                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: {
 | 
					    computed: {
 | 
				
			||||||
        getRssUrl(_this) {
 | 
					        getRssUrl(_this) {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue