diff --git a/Planet/Views/Articles/ArticleListView.swift b/Planet/Views/Articles/ArticleListView.swift index fd5f281e..3c42b091 100644 --- a/Planet/Views/Articles/ArticleListView.swift +++ b/Planet/Views/Articles/ArticleListView.swift @@ -56,6 +56,26 @@ struct ArticleListView: View { } return false } + case .videos: + return articles.filter { + if let myArticle = $0 as? MyArticleModel { + return myArticle.videoFilename != nil + } + if let followingArticle = $0 as? FollowingArticleModel { + return followingArticle.videoFilename != nil + } + return false + } + case .audios: + return articles.filter { + if let myArticle = $0 as? MyArticleModel { + return myArticle.audioFilename != nil + } + if let followingArticle = $0 as? FollowingArticleModel { + return followingArticle.audioFilename != nil + } + return false + } case .nav: return articles.filter { if let myArticle = $0 as? MyArticleModel, diff --git a/Planet/Views/Articles/ArticleListViewModel.swift b/Planet/Views/Articles/ArticleListViewModel.swift index dbb9e111..2fa4cacf 100644 --- a/Planet/Views/Articles/ArticleListViewModel.swift +++ b/Planet/Views/Articles/ArticleListViewModel.swift @@ -11,6 +11,8 @@ import Foundation enum ListViewFilter: String, CaseIterable { case all = "All" case pages = "Pages" + case videos = "Videos" + case audios = "Audios" case nav = "Navigation Items" case unread = "Unread" case starred = "Starred" @@ -29,6 +31,8 @@ enum ListViewFilter: String, CaseIterable { static let buttonLabels: [String: String] = [ "All": "Show All", "Pages": "Show Pages", + "Videos": "Show Videos", + "Audios": "Show Audios", "Navigation Items": "Show Navigation Items", "Unread": "Show Unread", "Starred": "Show All Starred", @@ -37,6 +41,8 @@ enum ListViewFilter: String, CaseIterable { static let emptyLabels: [String: String] = [ "All": "No Articles", "Pages": "No Pages", + "Videos": "No Videos", + "Audios": "No Audios", "Navigation Items": "No Navigation Items", "Unread": "No Unread Articles", "Starred": "No Starred Articles", @@ -53,6 +59,8 @@ enum ListViewFilter: String, CaseIterable { static let imageNames: [String: String] = [ "All": "line.3.horizontal.circle", "Pages": "doc.text", + "Videos": "film", + "Audios": "waveform", "Navigation Items": "link.circle", "Unread": "line.3.horizontal.circle.fill", "Starred": "star.fill",