private void txt_title_TextChanged(object sender, EventArgs e) { if (!loading) { _entry.SetValue("title", txt_title.Text); _entry.SetValue("VideoId", txt_videoId.Text); _entry.Title = _entry.GetValue("title"); _entry.ConfigString = _entry.GetConfigString(); } }
private void txt_title_TextChanged(object sender, EventArgs e) { if (!loading) { _entry.SetValue("title", txt_title.Text); _entry.SetValue("country", (string)cmb_country.SelectedItem); _entry.Title = _entry.GetValue("title"); _entry.ConfigString = _entry.GetConfigString(); } }
private void txt_title_TextChanged(object sender, EventArgs e) { if (!loading) { _entry.SetValue("title", txt_title.Text); _entry.SetValue("feed", (string)cmb_standardfeed.SelectedItem); _entry.SetValue("feedint", cmb_standardfeed.SelectedIndex.ToString()); _entry.Title = _entry.GetValue("title"); _entry.ConfigString = _entry.GetConfigString(); } }
private void txt_title_TextChanged(object sender, EventArgs e) { if (!loading) { _entry.SetValue("title", txt_title.Text); _entry.SetValue("items", numericUpDown1.Value.ToString()); _entry.SetValue("flat", checkBox1.Checked ? "true" : "false"); _entry.Title = _entry.GetValue("title"); _entry.ConfigString = _entry.GetConfigString(); } }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); if (entry.GetValue("all") == "true" && entry.GetValue("level") != "false") { res.Title = entry.Title; foreach (KeyValuePair <string, string> keyValuePair in Feeds) { SiteItemEntry newentry = new SiteItemEntry(); BillboardItem videoItem = new BillboardItem(); newentry.Provider = videoItem.Name; newentry.Title = keyValuePair.Key; newentry.SetValue("feed", keyValuePair.Key); res.Items.Add(new GenericListItem() { IsFolder = false, Title = newentry.Title, Tag = newentry }); } } else { string rssurl = Feeds[entry.GetValue("feed")]; res.ItemType = ItemType.Video; Uri uri = new Uri(rssurl); RssChannel myRssChannel = new RssChannel(uri); res.Title = myRssChannel.Title; foreach (RssItem item in myRssChannel.Items) { SiteItemEntry newentry = new SiteItemEntry(); VideoItem videoItem = new VideoItem(); newentry.Provider = videoItem.Name; newentry.Title = item.Title; newentry.SetValue("level", "false"); string[] title = item.Title.Split(','); newentry.SetValue("search", title[1].Trim() + " - " + title[0].Split(':')[1]); res.Items.Add(new GenericListItem() { IsFolder = false, Title = newentry.Title, Tag = newentry, LogoUrl = ArtistManager.Instance.GetArtistsImgUrl(GetArtistName(title[1])), DefaultImage = "defaultArtistBig.png" }); } } return(res); }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; int count = 0; int ii = 0; int.TryParse(entry.GetValue("items"), out ii); for (int i = Youtube2MP._settings.SearchHistory.Count; i > 0; i--) { count++; SiteItemEntry newentry = new SiteItemEntry(); SearchVideo searchVideo = new SearchVideo(); newentry.Provider = searchVideo.Name; newentry.SetValue("term", Youtube2MP._settings.SearchHistory[i - 1]); GenericListItem listItem = new GenericListItem() { Title = "Search result for :" + Youtube2MP._settings.SearchHistory[i - 1], IsFolder = true, //LogoUrl = YoutubeGUIBase.GetBestUrl(youTubeEntry.Media.Thumbnails), Tag = newentry }; res.Items.Add(listItem); if (count > ii) break; } return res; }
public GenericListItemCollections HomeGetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); string feedUrl = "http://gdata.youtube.com/feeds/api/users/" + entry.GetValue("id"); ProfileEntry profile = (ProfileEntry)Youtube2MP.service.Get(feedUrl); string img = ""; try { foreach (IExtensionElementFactory factory in profile.ExtensionElements) { if (factory.XmlName == "thumbnail") { img = ((Google.GData.Extensions.XmlExtension)factory).Node.Attributes[0].Value; } } } catch { } entry.SetValue("imgurl", img); GenericListItem listItem = new GenericListItem() { Title = entry.Title, IsFolder = true, LogoUrl = img, Tag = entry }; res.Items.Add(listItem); return(res); }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; res.Add(VevoFavorite()); res.Add(VevoUploads()); List <ArtistItem> artists = ArtistManager.Instance.GetVevoArtists(); foreach (ArtistItem artistItem in artists) { UserVideos userVideos = new UserVideos(); SiteItemEntry itemEntry = new SiteItemEntry(); itemEntry.Provider = userVideos.Name; itemEntry.SetValue("id", artistItem.User); string title = artistItem.Name; GenericListItem listItem = new GenericListItem() { Title = title, IsFolder = false, LogoUrl = artistItem.Img_url, DefaultImage = "defaultArtistBig.png", Tag = itemEntry }; res.Add(listItem); } res.ItemType = ItemType.Artist; return(res); }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; int count = 0; int ii = 0; int.TryParse(entry.GetValue("items"), out ii); for (int i = Youtube2MP._settings.SearchHistory.Count; i > 0; i--) { count++; SiteItemEntry newentry = new SiteItemEntry(); SearchVideo searchVideo = new SearchVideo(); newentry.Provider = searchVideo.Name; newentry.SetValue("term", Youtube2MP._settings.SearchHistory[i - 1]); GenericListItem listItem = new GenericListItem() { Title = "Search result for :" + Youtube2MP._settings.SearchHistory[i - 1], IsFolder = true, //LogoUrl = YoutubeGUIBase.GetBestUrl(youTubeEntry.Media.Thumbnails), Tag = newentry }; res.Items.Add(listItem); if (count > ii) { break; } } return(res); }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; res.Add(VevoFavorite()); res.Add(VevoUploads()); List<ArtistItem> artists = ArtistManager.Instance.GetVevoArtists(); foreach (ArtistItem artistItem in artists) { UserVideos userVideos = new UserVideos(); SiteItemEntry itemEntry = new SiteItemEntry(); itemEntry.Provider = userVideos.Name; itemEntry.SetValue("id", artistItem.User); string title = artistItem.Name; GenericListItem listItem = new GenericListItem() { Title = title, IsFolder = false, LogoUrl = artistItem.Img_url, DefaultImage = "defaultArtistBig.png", Tag = itemEntry }; res.Add(listItem); } res.ItemType = ItemType.Artist; return res; }
private void cmb_region_SelectedIndexChanged(object sender, EventArgs e) { if (!loading) { _entry.SetValue("region", (string)cmb_region.SelectedItem); //_entry.Title = _entry.GetValue("title"); _entry.ConfigString = _entry.GetConfigString(); } }
private GenericListItem VevoUploads() { SiteItemEntry itemEntry = new SiteItemEntry(); itemEntry.Provider = new UserVideos().Name; itemEntry.SetValue("id", "vevo"); string title = "Vevo uploads"; GenericListItem listItem = new GenericListItem() { Title = title, IsFolder = false, DefaultImage = "defaultArtistBig.png", Tag = itemEntry }; return(listItem); }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; if (string.IsNullOrEmpty(entry.GetValue("level"))) { for (int i = 0; i < stats.Count; i++) { SiteItemEntry newentry = new SiteItemEntry(); Statistics statistics = new Statistics(); newentry.Provider = statistics.Name; newentry.Title = stats[i]; newentry.SetValue("level", i.ToString()); res.Items.Add(new GenericListItem() { IsFolder = true, Title = newentry.Title, Tag = newentry, //LogoUrl = ArtistManager.Instance.GetArtistsImgUrl(GetArtistName(title[1])) }); } } if (entry.GetValue("level") == "0")//Recently played videos { res = DatabaseProvider.InstanInstance.GetRecentlyPlayed(); res.Title = Name + "/" + stats[0]; res.ItemType = ItemType.Video; } if (entry.GetValue("level") == "1")//Recently played videos { res = DatabaseProvider.InstanInstance.GetTopPlayed(); res.Title = Name + "/" + stats[1]; res.ItemType = ItemType.Video; } if (entry.GetValue("level") == "2")//Recently played videos { res = DatabaseProvider.InstanInstance.GetRandom(); res.Title = Name + "/" + stats[2]; res.ItemType = ItemType.Video; } return(res); }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; if (string.IsNullOrEmpty(entry.GetValue("level"))) { for (int i = 0; i < stats.Count; i++) { SiteItemEntry newentry = new SiteItemEntry(); Statistics statistics = new Statistics(); newentry.Provider = statistics.Name; newentry.Title = stats[i]; newentry.SetValue("level", i.ToString()); res.Items.Add(new GenericListItem() { IsFolder = true, Title = newentry.Title, Tag = newentry, //LogoUrl = ArtistManager.Instance.GetArtistsImgUrl(GetArtistName(title[1])) }); } } if (entry.GetValue("level") == "0")//Recently played videos { res = DatabaseProvider.InstanInstance.GetRecentlyPlayed(); res.Title = Name + "/" + stats[0]; res.ItemType = ItemType.Video; } if (entry.GetValue("level") == "1")//Recently played videos { res = DatabaseProvider.InstanInstance.GetTopPlayed(); res.Title = Name + "/" + stats[1]; res.ItemType = ItemType.Video; } if (entry.GetValue("level") == "2")//Recently played videos { res = DatabaseProvider.InstanInstance.GetRandom(); res.Title = Name + "/" + stats[2]; res.ItemType = ItemType.Video; } return res; }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; YouTubeQuery query = new YouTubeQuery(YouTubeQuery.CreatePlaylistsUri(entry.GetValue("id"))); PlaylistsFeed userPlaylists = Youtube2MP.service.GetPlaylists(query); res.Title = userPlaylists.Title.Text; foreach (PlaylistsEntry playlistsEntry in userPlaylists.Entries) { Google.GData.Extensions.XmlExtension e = playlistsEntry.FindExtension("group", "http://search.yahoo.com/mrss/") as Google.GData.Extensions.XmlExtension; string img = "http://i2.ytimg.com/vi/hqdefault.jpg"; try { img = e.Node.FirstChild.Attributes["url"].Value; } catch { } PlayList playList = new PlayList(); SiteItemEntry itemEntry = new SiteItemEntry(); itemEntry.Provider = playList.Name; itemEntry.SetValue("url", playlistsEntry.Content.AbsoluteUri); string title = playlistsEntry.Title.Text; GenericListItem listItem = new GenericListItem() { Title = title, IsFolder = false, LogoUrl = img.Replace("default", "hqdefault"), //DefaultImage = "defaultArtistBig.png", Tag = itemEntry }; res.Add(listItem); } res.ItemType = ItemType.Item; return(res); }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; { SiteItemEntry itemEntry = new SiteItemEntry(); itemEntry.Provider = new UserPlaylists().Name; itemEntry.SetValue("id", entry.GetValue("id")); string title = "Playlist"; GenericListItem listItem = new GenericListItem() { Title = title, IsFolder = false, LogoUrl = entry.GetValue("imgurl"), //DefaultImage = "defaultArtistBig.png", Tag = itemEntry }; res.Add(listItem); } { SiteItemEntry itemEntry = new SiteItemEntry(); itemEntry.Provider = new UserVideos().Name; itemEntry.SetValue("id", entry.GetValue("id")); string title = "Uploads"; GenericListItem listItem = new GenericListItem() { Title = title, IsFolder = false, LogoUrl = entry.GetValue("imgurl"), //DefaultImage = "defaultArtistBig.png", Tag = itemEntry }; res.Add(listItem); } res.ItemType = ItemType.Item; return(res); }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; { SiteItemEntry itemEntry = new SiteItemEntry(); itemEntry.Provider = new UserPlaylists().Name; itemEntry.SetValue("id", entry.GetValue("id")); string title = "Playlist"; GenericListItem listItem = new GenericListItem() { Title = title, IsFolder = false, LogoUrl = entry.GetValue("imgurl"), //DefaultImage = "defaultArtistBig.png", Tag = itemEntry }; res.Add(listItem); } { SiteItemEntry itemEntry = new SiteItemEntry(); itemEntry.Provider = new UserVideos().Name; itemEntry.SetValue("id", entry.GetValue("id")); string title = "Uploads"; GenericListItem listItem = new GenericListItem() { Title = title, IsFolder = false, LogoUrl = entry.GetValue("imgurl"), //DefaultImage = "defaultArtistBig.png", Tag = itemEntry }; res.Add(listItem); } res.ItemType = ItemType.Item; return res; }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); if (entry.GetValue("all") == "true" && entry.GetValue("level") != "false") { res.Title = entry.Title; foreach (KeyValuePair<string, string> keyValuePair in Feeds) { SiteItemEntry newentry = new SiteItemEntry(); BillboardItem videoItem = new BillboardItem(); newentry.Provider = videoItem.Name; newentry.Title = keyValuePair.Key; newentry.SetValue("feed", keyValuePair.Key); res.Items.Add(new GenericListItem() { IsFolder = false, Title = newentry.Title, Tag = newentry }); } } else { string rssurl = Feeds[entry.GetValue("feed")]; res.ItemType = ItemType.Video; Uri uri = new Uri(rssurl); RssChannel myRssChannel = new RssChannel(uri); res.Title = myRssChannel.Title; foreach (RssItem item in myRssChannel.Items) { SiteItemEntry newentry = new SiteItemEntry(); VideoItem videoItem = new VideoItem(); newentry.Provider = videoItem.Name; newentry.Title = item.Title; newentry.SetValue("level", "false"); string[] title = item.Title.Split(','); newentry.SetValue("search", title[1].Trim() + " - " + title[0].Split(':')[1]); res.Items.Add(new GenericListItem() { IsFolder = false, Title = newentry.Title, Tag = newentry, LogoUrl = ArtistManager.Instance.GetArtistsImgUrl(GetArtistName(title[1])), DefaultImage = "defaultArtistBig.png" }); } } return res; }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); if (entry.GetValue("letter") == "") { { res.Title = "Artists"; SiteItemEntry newentry1 = new SiteItemEntry(); newentry1.Provider = this.Name; newentry1.SetValue("letter", "true"); newentry1.SetValue("special", "1"); newentry1.Title = Translation.PlayedArtists; GenericListItem listItem1 = new GenericListItem() { Title = Translation.PlayedArtists, IsFolder = true, Tag = newentry1 }; res.Items.Add(listItem1); } { res.Title = "Artists"; SiteItemEntry newentry1 = new SiteItemEntry(); newentry1.Provider = this.Name; newentry1.SetValue("letter", "true"); newentry1.SetValue("special", "2"); newentry1.Title = Translation.ByTags; GenericListItem listItem1 = new GenericListItem() { Title = Translation.ByTags, IsFolder = true, Tag = newentry1 }; res.Items.Add(listItem1); } foreach (string letter in ArtistManager.Instance.GetArtistsLetters()) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "true"); newentry.SetValue("special", "false"); newentry.Title = letter; GenericListItem listItem = new GenericListItem() { Title = letter, IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } if (entry.GetValue("letter") == "true" && entry.GetValue("special") == "false") { res.Title = "Artists/Letter/" + entry.Title; List <ArtistItem> list = ArtistManager.Instance.GetArtists(entry.Title); if (list.Count > 500) { foreach (string letter in ArtistManager.Instance.GetArtistsLetters(entry.Title)) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "true"); newentry.SetValue("special", "false"); newentry.Title = letter; GenericListItem listItem = new GenericListItem() { Title = letter, IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } else { foreach (ArtistItem artistItem in list) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "false"); newentry.SetValue("id", artistItem.Id); newentry.SetValue("name", artistItem.Name); res.ItemType = ItemType.Artist; GenericListItem listItem = new GenericListItem() { Title = artistItem.Name, LogoUrl = string.IsNullOrEmpty(artistItem.Img_url.Trim()) ? "@" : artistItem.Img_url, IsFolder = true, DefaultImage = "defaultArtistBig.png", Tag = newentry }; res.Items.Add(listItem); } } } if (entry.GetValue("special") == "1") { res.Title = "Artists/" + Translation.PlayedArtists; foreach ( ArtistItem artistItem in ArtistManager.Instance.GetArtistsByIds(DatabaseProvider.InstanInstance.GetPlayedArtistIds(1))) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "false"); newentry.SetValue("id", artistItem.Id); newentry.SetValue("name", artistItem.Name); res.ItemType = ItemType.Artist; GenericListItem listItem = new GenericListItem() { Title = artistItem.Name, LogoUrl = string.IsNullOrEmpty(artistItem.Img_url.Trim()) ? "@" : artistItem.Img_url, IsFolder = true, DefaultImage = "defaultArtistBig.png", Tag = newentry }; res.Items.Add(listItem); } } if (entry.GetValue("special") == "2") { res.Title = "Artists/" + Translation.ByTags; foreach (string[] strings in ArtistManager.Instance.GetTags()) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "true"); newentry.SetValue("special", "3"); newentry.SetValue("tag", strings[0]); res.ItemType = ItemType.Item; GenericListItem listItem = new GenericListItem() { Title = strings[0], IsFolder = true, Title2 = strings[1], Tag = newentry }; res.Items.Add(listItem); } } if (entry.GetValue("special") == "3") { res.Title = "Artists/" + Translation.ByTags + "/" + entry.Title; foreach (ArtistItem artistItem in ArtistManager.Instance.GetArtistsByTag(entry.GetValue("tag"))) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "false"); newentry.SetValue("id", artistItem.Id); newentry.SetValue("name", artistItem.Name); res.ItemType = ItemType.Artist; GenericListItem listItem = new GenericListItem() { Title = artistItem.Name, LogoUrl = string.IsNullOrEmpty(artistItem.Img_url.Trim()) ? "@" : artistItem.Img_url, IsFolder = true, DefaultImage = "defaultArtistBig.png", Tag = newentry }; res.Items.Add(listItem); } } if (entry.GetValue("letter") == "false") { //res = ArtistManager.Instance.Grabber.GetArtistVideosIds(entry.GetValue("id")); res.ItemType = ItemType.Video; string user = ArtistManager.Instance.Grabber.GetArtistUser(entry.GetValue("id")); GenericListItemCollections resart = ArtistManager.Instance.Grabber.GetArtistVideosIds(entry.GetValue("name")); YouTubeFeed videos = null; try { if (!string.IsNullOrEmpty(user)) { YouTubeQuery query = new YouTubeQuery(string.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads", user)); query.NumberToRetrieve = 50; videos = Youtube2MP.service.Query(query); } } catch (Exception exception) { Log.Error(exception); } foreach (GenericListItem genericListItem in resart.Items) { YouTubeEntry tubeEntry = genericListItem.Tag as YouTubeEntry; YouTubeEntry searchEntry = GetVideFromFeed(Youtube2MP.GetVideoId(tubeEntry), videos); if (searchEntry != null) { searchEntry.Title.Text = tubeEntry.Title.Text; res.Items.Add(Youtube2MP.YouTubeEntry2ListItem(searchEntry)); } else { res.Items.Add(genericListItem); } } res.FolderType = 1; res.Title = "Artists/" + ArtistManager.Instance.GetArtistsById(entry.GetValue("id")).Name; } return(res); }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); if (entry.GetValue("letter") == "") { { res.Title = "Artists"; SiteItemEntry newentry1 = new SiteItemEntry(); newentry1.Provider = this.Name; newentry1.SetValue("letter", "true"); newentry1.SetValue("special", "1"); newentry1.Title = Translation.PlayedArtists; GenericListItem listItem1 = new GenericListItem() { Title = Translation.PlayedArtists, IsFolder = true, Tag = newentry1 }; res.Items.Add(listItem1); } { res.Title = "Artists"; SiteItemEntry newentry1 = new SiteItemEntry(); newentry1.Provider = this.Name; newentry1.SetValue("letter", "true"); newentry1.SetValue("special", "2"); newentry1.Title = Translation.ByTags; GenericListItem listItem1 = new GenericListItem() { Title = Translation.ByTags, IsFolder = true, Tag = newentry1 }; res.Items.Add(listItem1); } foreach (string letter in ArtistManager.Instance.GetArtistsLetters()) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "true"); newentry.SetValue("special", "false"); newentry.Title = letter; GenericListItem listItem = new GenericListItem() { Title = letter, IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } if (entry.GetValue("letter") == "true" && entry.GetValue("special") == "false") { res.Title = "Artists/Letter/" + entry.Title; List<ArtistItem> list = ArtistManager.Instance.GetArtists(entry.Title); if (list.Count > 500) { foreach (string letter in ArtistManager.Instance.GetArtistsLetters(entry.Title)) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "true"); newentry.SetValue("special", "false"); newentry.Title = letter; GenericListItem listItem = new GenericListItem() { Title = letter, IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } else { foreach (ArtistItem artistItem in list) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "false"); newentry.SetValue("id", artistItem.Id); newentry.SetValue("name", artistItem.Name); res.ItemType = ItemType.Artist; GenericListItem listItem = new GenericListItem() { Title = artistItem.Name, LogoUrl = string.IsNullOrEmpty(artistItem.Img_url.Trim()) ? "@" : artistItem.Img_url, IsFolder = true, DefaultImage = "defaultArtistBig.png", Tag = newentry }; res.Items.Add(listItem); } } } if (entry.GetValue("special") == "1") { res.Title = "Artists/" + Translation.PlayedArtists; foreach ( ArtistItem artistItem in ArtistManager.Instance.GetArtistsByIds(DatabaseProvider.InstanInstance.GetPlayedArtistIds(1))) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "false"); newentry.SetValue("id", artistItem.Id); newentry.SetValue("name", artistItem.Name); res.ItemType = ItemType.Artist; GenericListItem listItem = new GenericListItem() { Title = artistItem.Name, LogoUrl = string.IsNullOrEmpty(artistItem.Img_url.Trim()) ? "@" : artistItem.Img_url, IsFolder = true, DefaultImage = "defaultArtistBig.png", Tag = newentry }; res.Items.Add(listItem); } } if (entry.GetValue("special") == "2") { res.Title = "Artists/" + Translation.ByTags; foreach (string[] strings in ArtistManager.Instance.GetTags()) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "true"); newentry.SetValue("special", "3"); newentry.SetValue("tag",strings[0]); res.ItemType = ItemType.Item; GenericListItem listItem = new GenericListItem() { Title = strings[0], IsFolder = true, Title2 = strings[1], Tag = newentry }; res.Items.Add(listItem); } } if (entry.GetValue("special") == "3") { res.Title = "Artists/" + Translation.ByTags + "/" + entry.Title; foreach (ArtistItem artistItem in ArtistManager.Instance.GetArtistsByTag(entry.GetValue("tag"))) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("letter", "false"); newentry.SetValue("id", artistItem.Id); newentry.SetValue("name", artistItem.Name); res.ItemType = ItemType.Artist; GenericListItem listItem = new GenericListItem() { Title = artistItem.Name, LogoUrl = string.IsNullOrEmpty(artistItem.Img_url.Trim()) ? "@" : artistItem.Img_url, IsFolder = true, DefaultImage = "defaultArtistBig.png", Tag = newentry }; res.Items.Add(listItem); } } if (entry.GetValue("letter") == "false") { //res = ArtistManager.Instance.Grabber.GetArtistVideosIds(entry.GetValue("id")); res.ItemType = ItemType.Video; string user = ArtistManager.Instance.Grabber.GetArtistUser(entry.GetValue("id")); GenericListItemCollections resart = ArtistManager.Instance.Grabber.GetArtistVideosIds(entry.GetValue("name")); YouTubeFeed videos = null; try { if (!string.IsNullOrEmpty(user)) { YouTubeQuery query = new YouTubeQuery(string.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads", user)); query.NumberToRetrieve = 50; videos = Youtube2MP.service.Query(query); } } catch (Exception exception) { Log.Error(exception); } foreach (GenericListItem genericListItem in resart.Items) { YouTubeEntry tubeEntry = genericListItem.Tag as YouTubeEntry; YouTubeEntry searchEntry = GetVideFromFeed(Youtube2MP.GetVideoId(tubeEntry), videos); if (searchEntry != null) { searchEntry.Title.Text = tubeEntry.Title.Text; res.Items.Add(Youtube2MP.YouTubeEntry2ListItem(searchEntry)); } else { res.Items.Add(genericListItem); } } res.FolderType = 1; res.Title = "Artists/" + ArtistManager.Instance.GetArtistsById(entry.GetValue("id")).Name; } return res; }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; if (string.IsNullOrEmpty(entry.GetValue("level"))) { foreach (KeyValuePair<string, string> keyValuePair in _settings.Regions) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("region", keyValuePair.Key); newentry.SetValue("level", "1"); newentry.Title = keyValuePair.Key; GenericListItem listItem = new GenericListItem() { Title = keyValuePair.Key, IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } else if (entry.GetValue("level") == "1") { { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider =this.Name; newentry.SetValue("region", entry.GetValue("region")); newentry.SetValue("level", "2"); newentry.SetValue("hd", "false"); newentry.Title = entry.Title + "/" + "All"; GenericListItem listItem = new GenericListItem() { Title = "All", IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("region", entry.GetValue("region")); newentry.SetValue("level", "2"); newentry.SetValue("hd", "true"); newentry.Title = entry.Title + "/" + "HD"; GenericListItem listItem = new GenericListItem() { Title = "HD", IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } else if (entry.GetValue("level") == "2") { for (int i = 0; i < _settings.Cats.Count; i++) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = i > 4 ? "Standard feed" : this.Name; newentry.SetValue("region", entry.GetValue("region")); newentry.SetValue("hd", entry.GetValue("hd")); newentry.SetValue("level", "3"); newentry.SetValue("feedint", i.ToString()); newentry.Title = entry.Title + "/" + _settings.Cats[i]; GenericListItem listItem = new GenericListItem() { Title = _settings.Cats[i], IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } else if (entry.GetValue("level") == "3") { for (int i = 0; i < _settings.TimeList.Count; i++) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = "Standard feed"; newentry.SetValue("region", entry.GetValue("region")); newentry.SetValue("hd", entry.GetValue("hd")); newentry.SetValue("level", "4"); newentry.SetValue("feedint", entry.GetValue("feedint")); newentry.SetValue("time", _settings.TimeList[i]); newentry.Title = entry.Title + "/" + _settings.TimeList[i]; GenericListItem listItem = new GenericListItem() { Title = _settings.TimeList[i], IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } return res; }
public GenericListItemCollections GetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); res.Title = entry.Title; if (string.IsNullOrEmpty(entry.GetValue("level"))) { foreach (KeyValuePair <string, string> keyValuePair in _settings.Regions) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("region", keyValuePair.Key); newentry.SetValue("level", "1"); newentry.Title = keyValuePair.Key; GenericListItem listItem = new GenericListItem() { Title = keyValuePair.Key, IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } else if (entry.GetValue("level") == "1") { { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("region", entry.GetValue("region")); newentry.SetValue("level", "2"); newentry.SetValue("hd", "false"); newentry.Title = entry.Title + "/" + "All"; GenericListItem listItem = new GenericListItem() { Title = "All", IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = this.Name; newentry.SetValue("region", entry.GetValue("region")); newentry.SetValue("level", "2"); newentry.SetValue("hd", "true"); newentry.Title = entry.Title + "/" + "HD"; GenericListItem listItem = new GenericListItem() { Title = "HD", IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } else if (entry.GetValue("level") == "2") { for (int i = 0; i < _settings.Cats.Count; i++) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = i > 4 ? "Standard feed" : this.Name; newentry.SetValue("region", entry.GetValue("region")); newentry.SetValue("hd", entry.GetValue("hd")); newentry.SetValue("level", "3"); newentry.SetValue("feedint", i.ToString()); newentry.Title = entry.Title + "/" + _settings.Cats[i]; GenericListItem listItem = new GenericListItem() { Title = _settings.Cats[i], IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } else if (entry.GetValue("level") == "3") { for (int i = 0; i < _settings.TimeList.Count; i++) { SiteItemEntry newentry = new SiteItemEntry(); newentry.Provider = "Standard feed"; newentry.SetValue("region", entry.GetValue("region")); newentry.SetValue("hd", entry.GetValue("hd")); newentry.SetValue("level", "4"); newentry.SetValue("feedint", entry.GetValue("feedint")); newentry.SetValue("time", _settings.TimeList[i]); newentry.Title = entry.Title + "/" + _settings.TimeList[i]; GenericListItem listItem = new GenericListItem() { Title = _settings.TimeList[i], IsFolder = true, Tag = newentry }; res.Items.Add(listItem); } } return(res); }
public GenericListItemCollections HomeGetList(SiteItemEntry entry) { GenericListItemCollections res = new GenericListItemCollections(); string feedUrl = "http://gdata.youtube.com/feeds/api/users/"+entry.GetValue("id"); ProfileEntry profile = (ProfileEntry)Youtube2MP.service.Get(feedUrl); string img = ""; try { foreach (IExtensionElementFactory factory in profile.ExtensionElements) { if (factory.XmlName == "thumbnail") img = ((Google.GData.Extensions.XmlExtension)factory).Node.Attributes[0].Value; } } catch { } entry.SetValue("imgurl", img); GenericListItem listItem = new GenericListItem() { Title = entry.Title, IsFolder = true, LogoUrl = img, Tag = entry }; res.Items.Add(listItem); return res; }
private GenericListItem VevoFavorite() { SiteItemEntry itemEntry = new SiteItemEntry(); itemEntry.Provider = new FavoritesVideos().Name; itemEntry.SetValue("user", "vevo"); string title = "Vevo favorites"; GenericListItem listItem = new GenericListItem() { Title = title, IsFolder = false, DefaultImage = "defaultArtistBig.png", Tag = itemEntry }; return listItem; }