public void SetEntry(SiteItemEntry entry)
        {
            loading = true;
              _entry = entry;
              cmb_time.Items.Clear();
              cmb_standardfeed.Items.Clear();
              cmb_region.Items.Clear();
              cmb_time.Items.Add("");
              foreach (string s in Youtube2MP._settings.TimeList)
              {
            cmb_time.Items.Add(s);
              }

              cmb_standardfeed.Items.AddRange(Youtube2MP._settings.Cats.ToArray());
              cmb_standardfeed.SelectedIndex = 0;

              cmb_region.Items.Add("");
              foreach (KeyValuePair<string, string> valuePair in Youtube2MP._settings.Regions)
              {
            cmb_region.Items.Add(valuePair.Key);
              }

              _entry.PharseSettings(entry.ConfigString);
              txt_title.Text = _entry.GetValue("title");
              cmb_region.SelectedItem = _entry.GetValue("region");
              cmb_time.SelectedItem = _entry.GetValue("time");
              cmb_standardfeed.SelectedItem = _entry.GetValue("feed");
              loading = false;
        }
Beispiel #2
0
        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.FolderType = 1;
            string user = entry.GetValue("user");

            user = string.IsNullOrEmpty(user) ? "default" : user;
            YouTubeQuery query =
                new YouTubeQuery(string.Format("http://gdata.youtube.com/feeds/api/users/{0}/favorites", user));

            query.NumberToRetrieve = Youtube2MP.ITEM_IN_LIST;
            query.StartIndex       = entry.StartItem;
            if (entry.StartItem > 1)
            {
                res.Paged = true;
            }
            YouTubeFeed videos = Youtube2MP.service.Query(query);

            res.Title = videos.Title.Text;
            foreach (YouTubeEntry youTubeEntry in videos.Entries)
            {
                res.Items.Add(Youtube2MP.YouTubeEntry2ListItem(youTubeEntry));
            }
            res.Add(Youtube2MP.GetPager(entry, videos));
            res.ItemType = ItemType.Video;
            return(res);
        }
Beispiel #4
0
        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 = "Downloaded Videos";
            foreach (LocalFileStruct localFileStruct in Youtube2MP._settings.LocalFile.Items)
            {
                GenericListItem listItem = new GenericListItem()
                {
                    Title    = localFileStruct.Title,
                    IsFolder = false,
                    LogoUrl  = "",
                    Tag      = localFileStruct,
                    Title2   =
                        File.Exists(localFileStruct.LocalFile)
                                           ? (new FileInfo(localFileStruct.LocalFile).Length / 1024 / 1024).ToString("0") + " MB"
                                           : "",
                    DefaultImage =
                        Path.GetDirectoryName(localFileStruct.LocalFile) + "\\" +
                        Path.GetFileNameWithoutExtension(localFileStruct.LocalFile) + ".png"
                        //ParentTag = artistItem
                };
                res.Items.Add(listItem);
            }
            res.ItemType = ItemType.Video;
            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);
        }
Beispiel #7
0
        public GenericListItemCollections GetList(SiteItemEntry entry)
        {
            GenericListItemCollections res = new GenericListItemCollections();

            res.FolderType = 1;
            string url = string.Format("http://gdata.youtube.com/feeds/api/playlists/{0}", entry.GetValue("id"));

            if (!string.IsNullOrEmpty(entry.GetValue("url")))
            {
                url = entry.GetValue("url");
            }
            YouTubeQuery query = new YouTubeQuery(url);

            query.NumberToRetrieve = 50;
            do
            {
                YouTubeFeed videos = Youtube2MP.service.Query(query);
                res.Title = videos.Title.Text;
                foreach (YouTubeEntry youTubeEntry in videos.Entries)
                {
                    res.Items.Add(Youtube2MP.YouTubeEntry2ListItem(youTubeEntry));
                }
                query.StartIndex += 50;
                if (videos.TotalResults < query.StartIndex + 50)
                {
                    break;
                }
            } while (true);
            res.ItemType = ItemType.Video;
            return(res);
        }
        public void SetEntry(SiteItemEntry entry)
        {
            loading = true;
            _entry  = entry;
            int i = 0;

            int.TryParse(_entry.GetValue("items"), out i);
            numericUpDown1.Value = i;
            if (numericUpDown1.Value < 2)
            {
                numericUpDown1.Value = 2;
            }
            if (_entry.GetValue("flat") == "true")
            {
                checkBox1.Checked = true;
            }
            else
            {
                checkBox1.Checked = false;
            }

            txt_title.Text = _entry.GetValue("title");
            loading        = false;
            if (string.IsNullOrEmpty(txt_title.Text))
            {
                txt_title.Text = "Search History";
            }
        }
Beispiel #9
0
        public void SetEntry(SiteItemEntry entry)
        {
            loading = true;
            _entry  = entry;
            cmb_time.Items.Clear();
            cmb_standardfeed.Items.Clear();
            cmb_region.Items.Clear();
            cmb_time.Items.Add("");
            foreach (string s in Youtube2MP._settings.TimeList)
            {
                cmb_time.Items.Add(s);
            }

            cmb_standardfeed.Items.AddRange(Youtube2MP._settings.Cats.ToArray());
            cmb_standardfeed.SelectedIndex = 0;

            cmb_region.Items.Add("");
            foreach (KeyValuePair <string, string> valuePair in Youtube2MP._settings.Regions)
            {
                cmb_region.Items.Add(valuePair.Key);
            }

            _entry.PharseSettings(entry.ConfigString);
            txt_title.Text                = _entry.GetValue("title");
            cmb_region.SelectedItem       = _entry.GetValue("region");
            cmb_time.SelectedItem         = _entry.GetValue("time");
            cmb_standardfeed.SelectedItem = _entry.GetValue("feed");
            loading = false;
        }
        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;
            Country country = new Country(entry.GetValue("country"), Youtube2MP.LastFmProfile.Session);

            TopTrack[] tracks = country.GetTopTracks();
            foreach (TopTrack topTrack in tracks)
            {
                SiteItemEntry newentry  = new SiteItemEntry();
                VideoItem     videoItem = new VideoItem();
                newentry.Provider = videoItem.Name;
                newentry.Title    = topTrack.Item.ToString();
                res.Items.Add(new GenericListItem()
                {
                    IsFolder     = false,
                    Title        = newentry.Title,
                    Tag          = newentry,
                    LogoUrl      = ArtistManager.Instance.GetArtistsImgUrl(topTrack.Item.Artist.Name),
                    DefaultImage = "defaultArtistBig.png"
                });
            }
            res.ItemType = ItemType.Video;
            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;
 }
Beispiel #14
0
        public GenericListItemCollections GetList(SiteItemEntry entry)
        {
            GenericListItemCollections res = new GenericListItemCollections();

            res.Title = entry.Title;
            YouTubeQuery query =
                new YouTubeQuery(string.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads", entry.GetValue("id")));

            if (string.IsNullOrEmpty(entry.GetValue("id")))
            {
                query =
                    new YouTubeQuery(string.Format("http://gdata.youtube.com/feeds/api/users/default/uploads"));
            }
            query.NumberToRetrieve = Youtube2MP.ITEM_IN_LIST;
            query.StartIndex       = entry.StartItem;
            if (entry.StartItem > 1)
            {
                res.Paged = true;
            }
            YouTubeFeed videos = Youtube2MP.service.Query(query);

            res.Title = "Uploads by :" + videos.Authors[0].Name;
            foreach (YouTubeEntry youTubeEntry in videos.Entries)
            {
                res.Items.Add(Youtube2MP.YouTubeEntry2ListItem(youTubeEntry));
            }
            res.Add(Youtube2MP.GetPager(entry, videos));
            res.ItemType = ItemType.Video;
            return(res);
        }
Beispiel #15
0
        public void SetEntry(SiteItemEntry entry)
        {
            loading = true;
            _entry  = entry;

            txt_title.Text = _entry.GetValue("title");
            loading        = false;
        }
        public void SetEntry(SiteItemEntry entry)
        {
            loading = true;
              _entry = entry;

              txt_title.Text = _entry.GetValue("title");
              loading = false;
        }
Beispiel #17
0
        public void SetEntry(SiteItemEntry entry)
        {
            loading = true;
            _entry  = entry;

            txt_title.Text           = _entry.GetValue("title");
            cmb_country.SelectedItem = entry.GetValue("country");
            loading = false;
        }
Beispiel #18
0
 private void button7_Click(object sender, EventArgs e)
 {
     if (list_startpage.SelectedItems.Count > 0)
     {
         SiteItemEntry entry = list_startpage.SelectedItems[0].Tag as SiteItemEntry;
         FormItemList  dlg   = new FormItemList(Youtube2MP.GetList(entry));
         dlg.ShowDialog();
     }
 }
Beispiel #19
0
        public GenericListItemCollections GetList(SiteItemEntry entry)
        {
            GenericListItemCollections res = new GenericListItemCollections();

            res.Title = entry.Title;
            User user = new User(Youtube2MP._settings.LastFmUser, Youtube2MP.LastFmProfile.Session);

            switch (entry.GetValue("type"))
            {
            case "TopTracks":
            {
                TopTrack[] tracks = user.GetTopTracks();
                //user.GetRecentTracks()
                foreach (TopTrack topTrack in tracks)
                {
                    SiteItemEntry newentry  = new SiteItemEntry();
                    VideoItem     videoItem = new VideoItem();
                    newentry.Provider = videoItem.Name;
                    newentry.Title    = topTrack.Item.ToString();
                    res.Items.Add(new GenericListItem()
                        {
                            IsFolder     = false,
                            Title        = newentry.Title,
                            Tag          = newentry,
                            LogoUrl      = ArtistManager.Instance.GetArtistsImgUrl(topTrack.Item.Artist.Name),
                            DefaultImage = "defaultArtistBig.png"
                        });
                }
            }
            break;

            case "RecentTracks":
            {
                Track[] tracks = user.GetRecentTracks(40);
                //user.GetRecentTracks()
                foreach (Track topTrack in tracks)
                {
                    SiteItemEntry newentry  = new SiteItemEntry();
                    VideoItem     videoItem = new VideoItem();
                    newentry.Provider = videoItem.Name;
                    newentry.Title    = topTrack.ToString();
                    res.Items.Add(new GenericListItem()
                        {
                            IsFolder     = false,
                            Title        = newentry.Title,
                            Tag          = newentry,
                            LogoUrl      = ArtistManager.Instance.GetArtistsImgUrl(topTrack.Artist.Name),
                            DefaultImage = "defaultArtistBig.png"
                        });
                }
            }
            break;
            }
            res.ItemType = ItemType.Video;
            return(res);
        }
 public GenericListItemCollections GetList(SiteItemEntry entry)
 {
     GenericListItemCollections res = new GenericListItemCollections();
       res.Title = entry.Title;
       foreach (SiteItemEntry itemEntry in _menu.Items)
       {
     if (string.IsNullOrEmpty(itemEntry.ParentFolder))
       res.Add(Youtube2MP.SiteItemProvider[itemEntry.Provider].HomeGetList(itemEntry));
       }
       return res;
 }
        public GenericListItemCollections GetList(SiteItemEntry entry)
        {
            GenericListItemCollections res = new GenericListItemCollections();
              res.Title = entry.Title;
              User user = new User(Youtube2MP._settings.LastFmUser, Youtube2MP.LastFmProfile.Session);
              switch (entry.GetValue("type"))
              {
            case "TopTracks":
              {
            TopTrack[] tracks = user.GetTopTracks();
            //user.GetRecentTracks()
            foreach (TopTrack topTrack in tracks)
            {
              SiteItemEntry newentry = new SiteItemEntry();
              VideoItem videoItem = new VideoItem();
              newentry.Provider = videoItem.Name;
              newentry.Title = topTrack.Item.ToString();
              res.Items.Add(new GenericListItem()
              {
                IsFolder = false,
                Title = newentry.Title,
                Tag = newentry,
                LogoUrl = ArtistManager.Instance.GetArtistsImgUrl(topTrack.Item.Artist.Name),
                DefaultImage = "defaultArtistBig.png"
              });
            }
              }
              break;
            case "RecentTracks":
              {
            Track[] tracks = user.GetRecentTracks(40);
            //user.GetRecentTracks()
            foreach (Track topTrack in tracks)
            {
              SiteItemEntry newentry = new SiteItemEntry();
              VideoItem videoItem = new VideoItem();
              newentry.Provider = videoItem.Name;
              newentry.Title = topTrack.ToString();
              res.Items.Add(new GenericListItem()
              {
                IsFolder = false,
                Title = newentry.Title,
                Tag = newentry,
                LogoUrl = ArtistManager.Instance.GetArtistsImgUrl(topTrack.Artist.Name),
                DefaultImage = "defaultArtistBig.png"

              });
            }
              }
              break;
              }
              res.ItemType = ItemType.Video;
              return res;
        }
 public GenericListItemCollections GetList(SiteItemEntry entry)
 {
     GenericListItemCollections res = new GenericListItemCollections();
       res.Title = entry.Title;
       foreach (SiteItemEntry itemEntry in entry.Parent.Items)
       {
     if (itemEntry.ParentFolder == entry.Title)
       res.Items.Add(new GenericListItem {Title = itemEntry.Title, Tag = itemEntry, IsFolder = true,});
       }
       return res;
 }
        public void OnDownloadTimedEvent()
        {
            if (!Client.IsBusy && downloaQueue.Count > 0)
            {
                curentDownlodingFile = (DownloadFileObject)downloaQueue.Dequeue();
                try
                {
                    if (curentDownlodingFile.ListItem != null)
                    {
                        SiteItemEntry siteItemEntry = curentDownlodingFile.ListItem.MusicTag as SiteItemEntry;
                        if (siteItemEntry != null && !string.IsNullOrEmpty(siteItemEntry.GetValue("id")))
                        {
                            ArtistItem artistItem = ArtistManager.Instance.GetArtistsById(siteItemEntry.GetValue("id"));
                            if (string.IsNullOrEmpty(curentDownlodingFile.Url) || curentDownlodingFile.Url.Contains("@") ||
                                curentDownlodingFile.Url.Contains("ytimg.com"))
                            {
                                try
                                {
                                    Artist artist = new Artist(artistItem.Name, Youtube2MP.LastFmProfile.Session);
                                    artistItem.Img_url = artist.GetImageURL(ImageSize.Huge);
                                    ArtistManager.Instance.Save(artistItem);
                                    curentDownlodingFile.Url      = artistItem.Img_url;
                                    curentDownlodingFile.FileName = Youtube2MP.GetLocalImageFileName(curentDownlodingFile.Url);
                                }
                                catch
                                {
                                }
                            }
                        }
                    }

                    if (!string.IsNullOrEmpty(curentDownlodingFile.FileName) && !File.Exists(curentDownlodingFile.FileName))
                    {
                        try
                        {
                            Client.DownloadFileAsync(new Uri(curentDownlodingFile.Url), Path.GetTempPath() + @"\station.png");
                        }
                        catch
                        {
                            downloaQueue.Enqueue(curentDownlodingFile);
                        }
                    }
                    else
                    {
                        OnDownloadTimedEvent(null, null);
                    }
                }
                catch (Exception ex)
                {
                    Log.Error(ex);
                }
            }
        }
 public GenericListItemCollections HomeGetList(SiteItemEntry entry)
 {
     GenericListItemCollections res = new GenericListItemCollections();
       res.Items.Add(new GenericListItem()
       {
     IsFolder = true,
     Title = entry.Title,
     Tag =entry
       // new SiteItemEntry() { Provider = "Artists" }
       });
       return res;
 }
Beispiel #25
0
        public GenericListItemCollections HomeGetList(SiteItemEntry entry)
        {
            GenericListItemCollections res = new GenericListItemCollections();

            res.Items.Add(new GenericListItem()
            {
                IsFolder = true,
                Title    = entry.Title,
                Tag      = entry
            });
            return(res);
        }
Beispiel #26
0
 public void SetEntry(SiteItemEntry entry)
 {
     loading = true;
     _entry  = entry;
     cmb_region.Items.Clear();
     cmb_region.Items.Add("");
     foreach (KeyValuePair <string, string> valuePair in Youtube2MP._settings.Regions)
     {
         cmb_region.Items.Add(valuePair.Key);
     }
     cmb_region.SelectedItem = _entry.GetValue("region");
     loading = false;
 }
 public void SetEntry(SiteItemEntry entry)
 {
     loading = true;
       _entry = entry;
       cmb_region.Items.Clear();
       cmb_region.Items.Add("");
       foreach (KeyValuePair<string, string> valuePair in Youtube2MP._settings.Regions)
       {
     cmb_region.Items.Add(valuePair.Key);
       }
       cmb_region.SelectedItem = _entry.GetValue("region");
       loading = false;
 }
        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 HomeGetList(SiteItemEntry entry)
 {
     GenericListItemCollections res = new GenericListItemCollections();
       //entry.Title = Name;
       GenericListItem listItem = new GenericListItem()
       {
     Title = entry.Title,
     IsFolder = true,
     //LogoUrl = YoutubeGUIBase.GetBestUrl(youTubeEntry.Media.Thumbnails),
     Tag = entry
       };
       res.Items.Add(listItem);
       return res;
 }
        public GenericListItemCollections GetList(SiteItemEntry entry)
        {
            GenericListItemCollections res = new GenericListItemCollections();

            res.Title = entry.Title;
            foreach (SiteItemEntry itemEntry in _menu.Items)
            {
                if (string.IsNullOrEmpty(itemEntry.ParentFolder))
                {
                    res.Add(Youtube2MP.SiteItemProvider[itemEntry.Provider].HomeGetList(itemEntry));
                }
            }
            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 HomeGetList(SiteItemEntry entry)
        {
            GenericListItemCollections res = new GenericListItemCollections();

            res.Items.Add(new GenericListItem()
            {
                IsFolder = true,
                Title    = "User Downloaded Videos",
                Tag      = new SiteItemEntry()
                {
                    Provider = "UserDownloadedVideos"
                }
            });
            return(res);
        }
        public GenericListItemCollections HomeGetList(SiteItemEntry itemEntry)
        {
            GenericListItemCollections res = new GenericListItemCollections();

            GenericListItem listItem = new GenericListItem()
            {
                Title    = itemEntry.Title,
                IsFolder = true,
                //LogoUrl = YoutubeGUIBase.GetBestUrl(youTubeEntry.Media.Thumbnails),
                Tag = itemEntry
            };

            res.Items.Add(listItem);
            return(res);
        }
Beispiel #34
0
        public GenericListItemCollections GetList(SiteItemEntry entry)
        {
            GenericListItemCollections res = new GenericListItemCollections();

            res.Title = entry.Title;
            foreach (SiteItemEntry itemEntry in entry.Parent.Items)
            {
                if (itemEntry.ParentFolder == entry.Title)
                {
                    res.Items.Add(new GenericListItem {
                        Title = itemEntry.Title, Tag = itemEntry, IsFolder = true,
                    });
                }
            }
            return(res);
        }
Beispiel #35
0
        public void SetEntry(SiteItemEntry entry, string[] entries)
        {
            loading = true;
            _entry  = entry;

            cmb_standardfeed.Items.Clear();

            cmb_standardfeed.Items.AddRange(entries);
            cmb_standardfeed.SelectedIndex = 0;

            _entry.PharseSettings(entry.ConfigString);
            txt_title.Text = _entry.GetValue("title");
            cmb_standardfeed.SelectedItem = _entry.GetValue("feed");
            chk_all.Checked = _entry.GetValue("all") == "true";
            loading         = false;
        }
        public void SetEntry(SiteItemEntry entry,string[] entries)
        {
            loading = true;
              _entry = entry;

              cmb_standardfeed.Items.Clear();

              cmb_standardfeed.Items.AddRange(entries);
              cmb_standardfeed.SelectedIndex = 0;

              _entry.PharseSettings(entry.ConfigString);
              txt_title.Text = _entry.GetValue("title");
              cmb_standardfeed.SelectedItem = _entry.GetValue("feed");
              chk_all.Checked = _entry.GetValue("all") == "true";
              loading = false;
        }
Beispiel #37
0
        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 static GenericListItem GetPager(SiteItemEntry entry, YouTubeFeed videos)
 {
     if (videos.TotalResults > videos.StartIndex + ITEM_IN_LIST)
     {
         SiteItemEntry newEntry = entry.Copy();
         newEntry.StartItem += ITEM_IN_LIST;
         GenericListItem listItem = new GenericListItem()
         {
             Title        = Translation.NextPage,
             IsFolder     = true,
             DefaultImage = "NextPage.png",
             Tag          = newEntry
         };
         return(listItem);
     }
     return(null);
 }
Beispiel #39
0
        private void btn_add_provider_Click(object sender, EventArgs e)
        {
            ISiteItem     siteItem     = Youtube2MP.SiteItemProvider[cmb_providers.SelectedItem.ToString()];
            ListViewItem  listViewItem = new ListViewItem(siteItem.Name);
            SiteItemEntry entry        = new SiteItemEntry()
            {
                Provider = siteItem.Name, Title = siteItem.Name
            };

            if (siteItem.Name == "Folder")
            {
                listViewItem.BackColor = Color.Cyan;
            }
            listViewItem.Tag      = entry;
            listViewItem.Selected = true;
            list_startpage.Items.Add(listViewItem);
        }
Beispiel #40
0
 private void AddSubtree(TreeNode node, string parent)
 {
     if (string.IsNullOrEmpty(parent))
     {
         return;
     }
     foreach (ListViewItem item in list_startpage.Items)
     {
         SiteItemEntry siteItemEntry = item.Tag as SiteItemEntry;
         if (!string.IsNullOrEmpty(siteItemEntry.ParentFolder) && siteItemEntry.ParentFolder == parent)
         {
             if (siteItemEntry.Title != parent)
             {
                 AddSubtree(node.Nodes.Add(siteItemEntry.Title), siteItemEntry.Title);
             }
         }
     }
 }
        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 void SetEntry(SiteItemEntry entry)
        {
            loading = true;
              _entry = entry;
              int i = 0;
              int.TryParse(_entry.GetValue("items"), out i);
              numericUpDown1.Value = i;
              if (numericUpDown1.Value < 2)
            numericUpDown1.Value = 2;
              if (_entry.GetValue("flat") == "true")
            checkBox1.Checked = true;
              else
            checkBox1.Checked = false;

              txt_title.Text = _entry.GetValue("title");
              loading = false;
              if (string.IsNullOrEmpty(txt_title.Text))
            txt_title.Text = "Search History";
        }
 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;
 }
Beispiel #44
0
 private void BuildTree()
 {
     treeV.Nodes.Clear();
     foreach (ListViewItem item in list_startpage.Items)
     {
         SiteItemEntry siteItemEntry = item.Tag as SiteItemEntry;
         if (string.IsNullOrEmpty(siteItemEntry.ParentFolder))
         {
             if (siteItemEntry.Provider == "Folder")
             {
                 AddSubtree(treeV.Nodes.Add(siteItemEntry.Title), siteItemEntry.Title);
             }
             else
             {
                 treeV.Nodes.Add(siteItemEntry.Title);
             }
         }
     }
     treeV.ExpandAll();
 }
        public void SetEntry(SiteItemEntry entry)
        {
            loading = true;
              _entry = entry;
              cmb_time.Items.Clear();
              cmb_time.Items.Add("");
              foreach (string s in Youtube2MP._settings.TimeList)
              {
            cmb_time.Items.Add(s);
              }

              txt_title.Text = _entry.GetValue("title");
              txt_term.Text = _entry.GetValue("term");
              cmb_time.SelectedItem = _entry.GetValue("time");

              int i = 0;
              int.TryParse(_entry.GetValue("sortint"), out i);
              cmb_sort.SelectedIndex = i;
              loading = false;
        }
        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.FolderType = 1;
       string user = entry.GetValue("user");
       user = string.IsNullOrEmpty(user) ? "default" : user;
       YouTubeQuery query =
     new YouTubeQuery(string.Format("http://gdata.youtube.com/feeds/api/users/{0}/favorites",user));
       query.NumberToRetrieve = Youtube2MP.ITEM_IN_LIST;
       query.StartIndex = entry.StartItem;
       if (entry.StartItem > 1)
     res.Paged = true;
       YouTubeFeed videos = Youtube2MP.service.Query(query);
       res.Title = videos.Title.Text;
       foreach (YouTubeEntry youTubeEntry in videos.Entries)
       {
     res.Items.Add(Youtube2MP.YouTubeEntry2ListItem(youTubeEntry));
       }
       res.Add(Youtube2MP.GetPager(entry, videos));
       res.ItemType = ItemType.Video;
       return res;
 }
 public GenericListItemCollections GetList(SiteItemEntry entry)
 {
     GenericListItemCollections res = new GenericListItemCollections();
       res.Title = entry.Title;
       YouTubeQuery query =
     new YouTubeQuery(string.Format("http://gdata.youtube.com/feeds/api/users/{0}/uploads", entry.GetValue("id")));
       if (string.IsNullOrEmpty(entry.GetValue("id")))
     query =
       new YouTubeQuery(string.Format("http://gdata.youtube.com/feeds/api/users/default/uploads"));
       query.NumberToRetrieve = Youtube2MP.ITEM_IN_LIST;
       query.StartIndex = entry.StartItem;
       if (entry.StartItem > 1)
     res.Paged = true;
       YouTubeFeed videos = Youtube2MP.service.Query(query);
       res.Title = "Uploads by :" + videos.Authors[0].Name;
       foreach (YouTubeEntry youTubeEntry in videos.Entries)
       {
     res.Items.Add(Youtube2MP.YouTubeEntry2ListItem(youTubeEntry));
       }
       res.Add(Youtube2MP.GetPager(entry, videos));
       res.ItemType = ItemType.Video;
       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.FolderType = 1;
       string url = string.Format("http://gdata.youtube.com/feeds/api/playlists/{0}", entry.GetValue("id"));
       if (!string.IsNullOrEmpty(entry.GetValue("url")))
     url = entry.GetValue("url");
       YouTubeQuery query = new YouTubeQuery(url);
       query.NumberToRetrieve = 50;
       do
       {
     YouTubeFeed videos = Youtube2MP.service.Query(query);
     res.Title = videos.Title.Text;
     foreach (YouTubeEntry youTubeEntry in videos.Entries)
     {
       res.Items.Add(Youtube2MP.YouTubeEntry2ListItem(youTubeEntry));
     }
     query.StartIndex += 50;
     if (videos.TotalResults < query.StartIndex + 50)
       break;
       } while (true);
       res.ItemType = ItemType.Video;
       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;
 }
 public void Configure(SiteItemEntry entry)
 {
     ((UserVideosControl)ConfigControl).SetEntry(entry);
 }
 public void Configure(SiteItemEntry entry)
 {
 }
        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 void Configure(SiteItemEntry entry)
 {
     ((UserPlaylitsControl)ConfigControl).SetEntry(entry);
 }
 public void Configure(SiteItemEntry entry)
 {
     ((FolderControl)ConfigControl).SetEntry(entry);
 }
 public void Configure(SiteItemEntry entry)
 {
     //throw new NotImplementedException();
 }
        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();
              string query = YouTubeQuery.TopRatedVideo;
              bool usetime = true;
              res.Title = entry.Title;
              switch (Convert.ToInt32(entry.GetValue("feedint")))
              {
            case 0:
              query = YouTubeQuery.MostViewedVideo;
              break;
            case 1:
              query = YouTubeQuery.TopRatedVideo;
              break;
            case 2:
              query = YouTubeQuery.RecentlyFeaturedVideo;
              break;
            case 3:
              query = YouTubeQuery.MostDiscussedVideo;
              break;
            case 4:
              query = YouTubeQuery.FavoritesVideo;
              break;
            case 5:
              usetime = false;
              query = YouTubeQuery.MostLinkedVideo;
              break;
            case 6:
              usetime = false;
              query = YouTubeQuery.MostRespondedVideo;
              break;
            case 7:
              usetime = false;
              query = YouTubeQuery.MostRecentVideo;
              break;
            case 8:
              usetime = false;
              query = YouTubeQuery.StandardFeeds + "most_shared";
              break;
            case 9:
              usetime = false;
              query = YouTubeQuery.StandardFeeds + "on_the_web";
              break;

              }

              if (!string.IsNullOrEmpty(entry.GetValue("region")))
              {
            string reg = Youtube2MP._settings.Regions[entry.GetValue("region")];
            if (!string.IsNullOrEmpty(reg))
              query = query.Replace("standardfeeds", "standardfeeds/" + reg);
              }

              if (Youtube2MP._settings.MusicFilter)
            query += "_Music";

              YouTubeQuery tubeQuery = new YouTubeQuery(query);
              tubeQuery.NumberToRetrieve = Youtube2MP.ITEM_IN_LIST;
              tubeQuery.StartIndex = entry.StartItem;
              tubeQuery.SafeSearch = YouTubeQuery.SafeSearchValues.None;
              if (!string.IsNullOrEmpty(entry.GetValue("hd")) && entry.GetValue("hd") == "true")
              {
            tubeQuery.ExtraParameters = "hd=true";
              }

              if (usetime)
              {
            if (entry.GetValue("time") == "Today")
              tubeQuery.Time = YouTubeQuery.UploadTime.Today;
            if (entry.GetValue("time") == "This Week")
              tubeQuery.Time = YouTubeQuery.UploadTime.ThisWeek;
            if (entry.GetValue("time") == "This Month")
              tubeQuery.Time = YouTubeQuery.UploadTime.ThisMonth;
              }
              if (entry.StartItem > 1)
            res.Paged = true;
              YouTubeFeed videos = Youtube2MP.service.Query(tubeQuery);
              foreach (YouTubeEntry youTubeEntry in videos.Entries)
              {
            res.Items.Add(Youtube2MP.YouTubeEntry2ListItem(youTubeEntry));
              }

              res.Add(Youtube2MP.GetPager(entry, videos));
              res.FolderType = 1;
              res.ItemType = ItemType.Video;
              return res;
        }
 public void Configure(SiteItemEntry entry)
 {
     ((StandardFeedItemControl)ConfigControl).SetEntry(entry);
 }