Beispiel #1
0
        public ActionResult EmbedSong(int songId = invalidId, int pvId = invalidId, int?w = null, int?h = null,
                                      ContentLanguagePreference lang = ContentLanguagePreference.Default)
        {
            if (songId == invalidId)
            {
                return(NoId());
            }

            var song = songService.GetSongForApi(songId, SongOptionalFields.AdditionalNames | SongOptionalFields.PVs, lang);

            PVContract current = null;

            if (pvId != invalidId)
            {
                current = song.PVs.FirstOrDefault(p => p.Id == pvId);
            }

            if (current == null)
            {
                current = PVHelper.PrimaryPV(song.PVs);
            }

            var viewModel = new EmbedSongViewModel {
                Song      = song,
                CurrentPV = current,
                Width     = w,
                Height    = h
            };

            return(PartialView(viewModel));
        }
        public ActionResult Index()
        {
            var webPVInfo = PVHelper.GetTheWebPVInfo();
            Dictionary <DateTime, List <PVInfo> > dicDateToLstPVInfo = new Dictionary <DateTime, List <PVInfo> >();

            foreach (var pvInfo in webPVInfo.SalesLstPVInfo)
            {
                var pvTime = DateTime.MinValue;
                if (DateTime.TryParse(pvInfo.PVTime, out pvTime))
                {
                    if (dicDateToLstPVInfo.ContainsKey(pvTime.Date))
                    {
                        dicDateToLstPVInfo[pvTime.Date].Add(pvInfo);
                    }
                    else
                    {
                        dicDateToLstPVInfo.Add(pvTime.Date, new List <PVInfo>()
                        {
                            pvInfo
                        });
                    }
                }
            }

            return(View(dicDateToLstPVInfo.OrderBy(item => item.Key)));
        }
        // GET: /<controller>/
        public IActionResult Index(string groupID = "", int endstart = 0)
        {
            _58CityHouseCrawler.CapturPinPaiHouseInfo();

            PVHelper.WritePVInfo(Request.HttpContext.Connection.RemoteIpAddress.ToString(), Request.Path);
            return(View());
        }
Beispiel #4
0
        public AlbumDetails(AlbumDetailsContract contract)
        {
            ParamIs.NotNull(() => contract);

            AdditionalNames = contract.AdditionalNames;
            ArtistString    = contract.ArtistString;
            CanEdit         = EntryPermissionManager.CanEdit(MvcApplication.LoginManager, contract);
            CommentCount    = contract.CommentCount;
            CreateDate      = contract.CreateDate;
            Description     = contract.Description;
            Deleted         = contract.Deleted;
            DiscType        = contract.DiscType;
            Draft           = contract.Status == EntryStatus.Draft;
            Hits            = contract.Hits;
            Id             = contract.Id;
            LatestComments = contract.LatestComments;
            MergedTo       = contract.MergedTo;
            Name           = contract.Name;
            OwnedBy        = contract.OwnedCount;
            Pictures       = contract.Pictures;
            PVs            = contract.PVs;
            RatingAverage  = contract.RatingAverage;
            RatingCount    = contract.RatingCount;
            Songs          = contract.Songs.GroupBy(s => s.DiscNumber).ToArray();
            Status         = contract.Status;
            Tags           = contract.Tags;
            UserHasAlbum   = contract.AlbumForUser != null;
            Version        = contract.Version;
            WebLinks       = contract.WebLinks;
            WishlistedBy   = contract.WishlistCount;
            mime           = contract.CoverPictureMime;

            if (contract.AlbumForUser != null)
            {
                AlbumMediaType      = contract.AlbumForUser.MediaType;
                AlbumPurchaseStatus = contract.AlbumForUser.PurchaseStatus;
                CollectionRating    = contract.AlbumForUser.Rating;
            }

            if (contract.OriginalRelease != null)
            {
                CatNum          = contract.OriginalRelease.CatNum;
                ReleaseEvent    = contract.OriginalRelease.EventName;
                ReleaseDate     = contract.OriginalRelease.ReleaseDate;
                FullReleaseDate = ReleaseDate.Year.HasValue && ReleaseDate.Month.HasValue && ReleaseDate.Day.HasValue ? (DateTime?)new DateTime(ReleaseDate.Year.Value, ReleaseDate.Month.Value, ReleaseDate.Day.Value) : null;
            }

            var artists = contract.ArtistLinks;

            Bands        = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Band)).ToArray();
            Circles      = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Circle)).ToArray();
            Labels       = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Label)).ToArray();
            Producers    = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Producer)).ToArray();
            Vocalists    = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Vocalist)).ToArray();
            OtherArtists = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Other) || a.Categories.HasFlag(ArtistCategories.Animator)).ToArray();

            PrimaryPV = PVHelper.PrimaryPV(PVs);
        }
 public ActionResult GetPVCount()
 {
     try
     {
         var pvInfo = PVHelper.GetTheWebPVInfo();
         return(Json(new { IsSuccess = true, PVCount = pvInfo.PVCount }));
     }
     catch (Exception ex)
     {
         return(Json(new { IsSuccess = false, Error = ex.ToString() }));
     }
 }
Beispiel #6
0
 public SongController(
     SongService service,
     SongQueries queries,
     SongListQueries songListQueries,
     MarkdownParser markdownParser,
     PVHelper pvHelper)
 {
     _service         = service;
     _queries         = queries;
     _songListQueries = songListQueries;
     _markdownParser  = markdownParser;
     _pvHelper        = pvHelper;
 }
Beispiel #7
0
 public AlbumController(
     AlbumService service,
     AlbumQueries queries,
     UserQueries userQueries,
     AlbumDescriptionGenerator albumDescriptionGenerator,
     MarkdownParser markdownParser,
     PVHelper pvHelper)
 {
     Service      = service;
     _queries     = queries;
     _userQueries = userQueries;
     _albumDescriptionGenerator = albumDescriptionGenerator;
     _markdownParser            = markdownParser;
     _pvHelper = pvHelper;
 }
Beispiel #8
0
 public ExtController(
     IEntryUrlParser entryUrlParser,
     IAggregatedEntryImageUrlFactory entryThumbPersister,
     AlbumService albumService,
     ArtistService artistService,
     EventQueries eventQueries,
     SongQueries songService,
     TagQueries tagQueries,
     PVHelper pvHelper)
 {
     _entryUrlParser      = entryUrlParser;
     _entryThumbPersister = entryThumbPersister;
     _albumService        = albumService;
     _artistService       = artistService;
     _eventQueries        = eventQueries;
     _songService         = songService;
     _tagQueries          = tagQueries;
     _pvHelper            = pvHelper;
 }
Beispiel #9
0
        /// <summary>
        /// Returns a PV player with song rating by song Id. Primary PV will be chosen.
        /// </summary>
        public ActionResult PVPlayerWithRating(int songId = invalidId)
        {
            if (songId == invalidId)
            {
                return(NoId());
            }

            var song = queries.GetSongWithPVAndVote(songId, true, GetHostnameForValidHit());
            var pv   = PVHelper.PrimaryPV(song.PVs);

            if (pv == null)
            {
                return(new EmptyResult());
            }

            var view = RenderPartialViewToString("PVs/_PVEmbedDynamic", pv);

            return(LowercaseJson(new SongWithPVPlayerAndVoteContract {
                Song = song, PlayerHtml = view, PVService = pv.Service
            }));
        }
Beispiel #10
0
        private string GetNicoMimiUrl(SongDetailsContract contract)
        {
            // Don't show nicomimi link for free songs.
            if (contract.Tags.Any(t =>
                                  t.TagName.Equals(Model.Domain.Tags.Tag.CommonTag_Free, StringComparison.InvariantCultureIgnoreCase) ||
                                  t.TagName.Equals(Model.Domain.Tags.Tag.CommonTag_Nicovideo_downloadmusic, StringComparison.InvariantCultureIgnoreCase)))
            {
                return(string.Empty);
            }

            var nicoId   = contract.Song.NicoId;
            var nicoPvId = PVHelper.GetNicoId(contract.PVs, nicoId);

            if (!string.IsNullOrEmpty(nicoPvId))
            {
                return(string.Format("http://www.nicomimi.net/play/{0}", nicoPvId));
            }
            else
            {
                return(string.Empty);
            }
        }
 // GET: /<controller>/
 public IActionResult Index(string groupID = "", int endstart = 0)
 {
     PVHelper.WritePVInfo(Request.HttpContext.Connection.RemoteIpAddress.ToString(), Request.Path);
     return(View());
 }
Beispiel #12
0
        public SongDetails(SongDetailsContract contract, IUserPermissionContext userContext, PVHelper pvHelper)
        {
            ParamIs.NotNull(() => contract);

            Contract                   = contract;
            AdditionalNames            = contract.AdditionalNames;
            Albums                     = contract.Albums;
            AlternateVersions          = contract.AlternateVersions.Where(a => a.SongType != SongType.Original).ToArray();
            ArtistString               = contract.ArtistString;
            BrowsedAlbumId             = contract.Album?.Id;
            CanEdit                    = EntryPermissionManager.CanEdit(userContext, contract.Song);
            CanEditPersonalDescription = contract.CanEditPersonalDescription;
            CanRemoveTagUsages         = contract.CanRemoveTagUsages;
            CommentCount               = contract.CommentCount;
            CreateDate                 = contract.CreateDate;
            DefaultLanguageSelection   = contract.TranslatedName.DefaultLanguage;
            Deleted                    = contract.Deleted;
            Draft                     = contract.Song.Status == EntryStatus.Draft;
            FavoritedTimes            = contract.Song.FavoritedTimes;
            Hits                      = contract.Hits;
            Id                        = contract.Song.Id;
            IsFavorited               = contract.UserRating != SongVoteRating.Nothing;
            LatestComments            = contract.LatestComments;
            Length                    = contract.Song.LengthSeconds;
            LikedTimes                = contract.LikeCount;
            ListCount                 = contract.ListCount;
            Lyrics                    = contract.LyricsFromParents;
            MergedTo                  = contract.MergedTo;
            Name                      = contract.Song.Name;
            NicoId                    = contract.Song.NicoId;
            Notes                     = contract.Notes;
            OriginalVersion           = (contract.Song.SongType != SongType.Original ? contract.OriginalVersion : null);
            Pools                     = contract.Pools;
            PublishDate               = contract.Song.PublishDate;
            RatingScore               = contract.Song.RatingScore;
            ReleaseEvent              = contract.ReleaseEvent;
            PersonalDescriptionText   = contract.PersonalDescriptionText;
            PersonalDescriptionAuthor = contract.PersonalDescriptionAuthor;
            SongType                  = contract.Song.SongType;
            SongTypeTag               = contract.SongTypeTag;
            Status                    = contract.Song.Status;
            Suggestions               = contract.Suggestions;
            Tags                      = contract.Tags;
            UserRating                = contract.UserRating;
            WebLinks                  = contract.WebLinks.ToList();
            ContentFocus              = SongHelper.GetContentFocus(SongType);

            Animators    = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Animator)).ToArray();
            Bands        = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Band)).ToArray();
            Illustrators = ContentFocus == ContentFocus.Illustration ? contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Illustrator)).ToArray() : null;
            Performers   = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Vocalist)).ToArray();
            Producers    = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Producer)).ToArray();
            var subjectsForThis = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Subject)).ToArray();

            Subject      = subjectsForThis.Any() ? subjectsForThis : contract.SubjectsFromParents;
            OtherArtists = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Circle) ||
                                                  a.Categories.HasFlag(ArtistCategories.Label) ||
                                                  a.Categories.HasFlag(ArtistCategories.Other) ||
                                                  (ContentFocus != ContentFocus.Illustration && a.Categories.HasFlag(ArtistCategories.Illustrator))).ToArray();

            var pvs = contract.PVs;

            OriginalPVs     = pvs.Where(p => p.PVType == PVType.Original).ToArray();
            OtherPVs        = pvs.Where(p => p.PVType != PVType.Original).ToArray();
            PrimaryPV       = pvHelper.PrimaryPV(pvs);
            ThumbUrl        = VideoServiceHelper.GetThumbUrlPreferNotNico(pvs);
            ThumbUrlMaxSize = VideoServiceHelper.GetMaxSizeThumbUrl(pvs) ?? ThumbUrl;

            if (PrimaryPV == null && !string.IsNullOrEmpty(NicoId))
            {
                PrimaryPV = new PVContract {
                    PVId = NicoId, Service = PVService.NicoNicoDouga
                }
            }
            ;

            if (pvs.All(p => p.Service != PVService.Youtube))
            {
                var nicoPV = VideoServiceHelper.PrimaryPV(pvs, PVService.NicoNicoDouga);
                var query  = HttpUtility.UrlEncode((nicoPV != null && !string.IsNullOrEmpty(nicoPV.Name))
                                        ? nicoPV.Name
                                        : $"{ArtistString} {Name}");

                WebLinks.Add(new WebLinkContract($"http://www.youtube.com/results?search_query={query}",
                                                 ViewRes.Song.DetailsStrings.SearchYoutube, WebLinkCategory.Other, disabled: false));
            }

            JsonModel = new SongDetailsAjax(this, contract.PreferredLyrics, contract.Song.Version);

            MinMilliBpm = contract.MinMilliBpm;
            MaxMilliBpm = contract.MaxMilliBpm;
        }
 public ActionResult WritePVToJson()
 {
     PVHelper.WriteToJsonFile();
     return(View(PVHelper.GetTheWebPVInfo()));
 }
Beispiel #14
0
        //
        // GET: /PeopleRenting/

        public ActionResult Index()
        {
            PVHelper.WritePVInfo(Request.HttpContext.Connection.RemoteIpAddress.ToString(), Request.Path);
            return(View());
        }
Beispiel #15
0
        public SongDetails(SongDetailsContract contract)
        {
            ParamIs.NotNull(() => contract);

            AdditionalNames   = contract.AdditionalNames;
            Albums            = contract.Albums;
            AlternateVersions = contract.AlternateVersions.Where(a => a.SongType != SongType.Original).ToArray();
            ArtistString      = contract.ArtistString;
            CanEdit           = EntryPermissionManager.CanEdit(MvcApplication.LoginManager, contract.Song);
            CommentCount      = contract.CommentCount;
            CreateDate        = contract.CreateDate;
            Deleted           = contract.Deleted;
            Draft             = contract.Song.Status == EntryStatus.Draft;
            FavoritedTimes    = contract.Song.FavoritedTimes;
            Hits            = contract.Hits;
            Id              = contract.Song.Id;
            IsFavorited     = contract.UserRating != SongVoteRating.Nothing;
            LatestComments  = contract.LatestComments;
            LikedTimes      = contract.LikeCount;
            Lyrics          = contract.LyricsFromParents;
            Name            = contract.Song.Name;
            NicoId          = contract.Song.NicoId;
            Notes           = contract.Notes;
            OriginalVersion = (contract.Song.SongType != SongType.Original ? contract.OriginalVersion : null);
            Pools           = contract.Pools;
            RatingScore     = contract.Song.RatingScore;
            SongType        = contract.Song.SongType;
            Status          = contract.Song.Status;
            Tags            = contract.Tags;
            UserRating      = contract.UserRating;
            WebLinks        = contract.WebLinks.ToList();

            Animators    = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Animator)).ToArray();
            Performers   = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Vocalist)).ToArray();
            Producers    = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Producer)).ToArray();
            OtherArtists = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Circle) ||
                                                  a.Categories.HasFlag(ArtistCategories.Label) ||
                                                  a.Categories.HasFlag(ArtistCategories.Other)).ToArray();

            var pvs = contract.PVs;

            OriginalPVs = pvs.Where(p => p.PVType == PVType.Original).ToArray();
            OtherPVs    = pvs.Where(p => p.PVType != PVType.Original).ToArray();
            PrimaryPV   = PVHelper.PrimaryPV(pvs);

            if (PrimaryPV == null && !string.IsNullOrEmpty(NicoId))
            {
                PrimaryPV = new PVContract {
                    PVId = NicoId, Service = PVService.NicoNicoDouga
                }
            }
            ;

            var nicoPvId = PVHelper.GetNicoId(pvs, NicoId);

            if (!string.IsNullOrEmpty(nicoPvId))
            {
                WebLinks.Add(new WebLinkContract(VideoServiceUrlFactory.NicoSound.CreateUrl(nicoPvId),
                                                 ViewRes.Song.DetailsStrings.CheckNicoSound, WebLinkCategory.Other));
            }

            if (pvs.All(p => p.Service != PVService.Youtube))
            {
                var nicoPV = VideoServiceHelper.PrimaryPV(pvs, PVService.NicoNicoDouga);
                var query  = (nicoPV != null && !string.IsNullOrEmpty(nicoPV.Name))
                                        ? nicoPV.Name
                                        : string.Format("{0} {1}", ArtistString, Name);

                WebLinks.Add(new WebLinkContract(string.Format("http://www.youtube.com/results?search_query={0}", query),
                                                 ViewRes.Song.DetailsStrings.SearchYoutube, WebLinkCategory.Other));
            }
        }
Beispiel #16
0
        public AlbumDetails(AlbumDetailsContract contract, IUserPermissionContext permissionContext)
        {
            ParamIs.NotNull(() => contract);

            AdditionalNames            = contract.AdditionalNames;
            ArtistString               = contract.ArtistString;
            CanEdit                    = EntryPermissionManager.CanEdit(permissionContext, contract);
            CanEditPersonalDescription = contract.CanEditPersonalDescription;
            CanRemoveTagUsages         = contract.CanRemoveTagUsages;
            CommentCount               = contract.CommentCount;
            CreateDate                 = contract.CreateDate;
            Description                = contract.Description;
            Deleted                    = contract.Deleted;
            DiscType                   = contract.DiscType;
            Draft                     = contract.Status == EntryStatus.Draft;
            Hits                      = contract.Hits;
            Id                        = contract.Id;
            LatestComments            = contract.LatestComments;
            LatestReview              = contract.Stats.LatestReview;
            LatestReviewRatingScore   = contract.Stats.LatestReviewRatingScore;
            MergedTo                  = contract.MergedTo;
            Name                      = contract.Name;
            OwnedBy                   = contract.Stats.OwnedCount;
            PersonalDescriptionText   = contract.PersonalDescriptionText;
            PersonalDescriptionAuthor = contract.PersonalDescriptionAuthor;
            Pictures                  = contract.Pictures;
            PVs                       = contract.PVs;
            RatingAverage             = contract.RatingAverage;
            RatingCount               = contract.RatingCount;
            ReviewCount               = contract.Stats.ReviewCount;
            Status                    = contract.Status;
            Tags                      = contract.Tags;
            TotalLength               = contract.TotalLength;
            UserHasAlbum              = contract.AlbumForUser != null;
            Version                   = contract.Version;
            WebLinks                  = contract.WebLinks;
            WishlistedBy              = contract.Stats.WishlistCount;
            mime                      = contract.CoverPictureMime;

            var songsByDiscs = contract.Songs.GroupBy(s => s.DiscNumber);

            Discs =
                (from songsByDisc in songsByDiscs
                 let dn = songsByDisc.Key
                          select new AlbumDisc(dn, songsByDisc, contract.Discs.ContainsKey(dn) ? contract.Discs[dn] : null))
                .ToArray();

            if (contract.AlbumForUser != null)
            {
                AlbumMediaType      = contract.AlbumForUser.MediaType;
                AlbumPurchaseStatus = contract.AlbumForUser.PurchaseStatus;
                CollectionRating    = contract.AlbumForUser.Rating;
            }

            if (contract.OriginalRelease != null)
            {
                CatNum          = contract.OriginalRelease.CatNum;
                ReleaseEvent    = contract.OriginalRelease.ReleaseEvent;
                ReleaseDate     = contract.OriginalRelease.ReleaseDate;
                FullReleaseDate = ReleaseDate.Year.HasValue && ReleaseDate.Month.HasValue && ReleaseDate.Day.HasValue ? (DateTime?)new DateTime(ReleaseDate.Year.Value, ReleaseDate.Month.Value, ReleaseDate.Day.Value) : null;
            }

            var artists = contract.ArtistLinks;

            ContentFocus = AlbumHelper.GetContentFocus(DiscType);

            Bands        = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Band)).ToArray();
            Circles      = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Circle)).ToArray();
            Illustrators = ContentFocus == ContentFocus.Illustration ? artists.Where(a => a.Categories.HasFlag(ArtistCategories.Illustrator)).ToArray() : null;
            Labels       = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Label)).ToArray();
            Producers    = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Producer)).ToArray();
            Vocalists    = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Vocalist)).ToArray();
            Subject      = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Subject)).ToArray();
            OtherArtists = artists.Where(a => a.Categories.HasFlag(ArtistCategories.Other) ||
                                         a.Categories.HasFlag(ArtistCategories.Animator) ||
                                         (ContentFocus != ContentFocus.Illustration && a.Categories.HasFlag(ArtistCategories.Illustrator))).ToArray();

            PrimaryPV = PVHelper.PrimaryPV(PVs);
        }
Beispiel #17
0
 public EmbedSongViewModel(PVHelper pvHelper)
 {
     _pvHelper = pvHelper;
 }
Beispiel #18
0
        public SongDetails(SongDetailsContract contract)
        {
            ParamIs.NotNull(() => contract);

            Contract                 = contract;
            AdditionalNames          = contract.AdditionalNames;
            Albums                   = contract.Albums;
            AlternateVersions        = contract.AlternateVersions.Where(a => a.SongType != SongType.Original).ToArray();
            ArtistString             = contract.ArtistString;
            CanEdit                  = EntryPermissionManager.CanEdit(MvcApplication.LoginManager, contract.Song);
            CommentCount             = contract.CommentCount;
            CreateDate               = contract.CreateDate;
            DefaultLanguageSelection = contract.TranslatedName.DefaultLanguage;
            Deleted                  = contract.Deleted;
            Draft           = contract.Song.Status == EntryStatus.Draft;
            FavoritedTimes  = contract.Song.FavoritedTimes;
            Hits            = contract.Hits;
            Id              = contract.Song.Id;
            IsFavorited     = contract.UserRating != SongVoteRating.Nothing;
            LatestComments  = contract.LatestComments;
            Length          = contract.Song.LengthSeconds;
            LikedTimes      = contract.LikeCount;
            ListCount       = contract.ListCount;
            Lyrics          = contract.LyricsFromParents;
            MergedTo        = contract.MergedTo;
            Name            = contract.Song.Name;
            NicoId          = contract.Song.NicoId;
            Notes           = contract.Notes;
            OriginalVersion = (contract.Song.SongType != SongType.Original ? contract.OriginalVersion : null);
            Pools           = contract.Pools;
            RatingScore     = contract.Song.RatingScore;
            SongType        = contract.Song.SongType;
            Status          = contract.Song.Status;
            Tags            = contract.Tags;
            UserRating      = contract.UserRating;
            WebLinks        = contract.WebLinks.ToList();

            Animators    = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Animator)).ToArray();
            Bands        = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Band)).ToArray();
            Performers   = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Vocalist)).ToArray();
            Producers    = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Producer)).ToArray();
            OtherArtists = contract.Artists.Where(a => a.Categories.HasFlag(ArtistCategories.Circle) ||
                                                  a.Categories.HasFlag(ArtistCategories.Label) ||
                                                  a.Categories.HasFlag(ArtistCategories.Other)).ToArray();

            var pvs = contract.PVs;

            OriginalPVs     = pvs.Where(p => p.PVType == PVType.Original).ToArray();
            OtherPVs        = pvs.Where(p => p.PVType != PVType.Original).ToArray();
            PrimaryPV       = PVHelper.PrimaryPV(pvs);
            ThumbUrl        = VideoServiceHelper.GetThumbUrlPreferNotNico(pvs);
            ThumbUrlMaxSize = VideoServiceHelper.GetMaxSizeThumbUrl(pvs) ?? ThumbUrl;

            /*var nicoMimiUrl = GetNicoMimiUrl(contract);
             * if (!string.IsNullOrEmpty(nicoMimiUrl)) {
             *      WebLinks.Add(new WebLinkContract(nicoMimiUrl, ViewRes.Song.DetailsStrings.NicoMimiDownload, WebLinkCategory.Other));
             * }*/

            if (PrimaryPV == null && !string.IsNullOrEmpty(NicoId))
            {
                PrimaryPV = new PVContract {
                    PVId = NicoId, Service = PVService.NicoNicoDouga
                }
            }
            ;

            if (pvs.All(p => p.Service != PVService.Youtube))
            {
                var nicoPV = VideoServiceHelper.PrimaryPV(pvs, PVService.NicoNicoDouga);
                var query  = HttpUtility.UrlEncode((nicoPV != null && !string.IsNullOrEmpty(nicoPV.Name))
                                        ? nicoPV.Name
                                        : string.Format("{0} {1}", ArtistString, Name));

                WebLinks.Add(new WebLinkContract(string.Format("http://www.youtube.com/results?search_query={0}", query),
                                                 ViewRes.Song.DetailsStrings.SearchYoutube, WebLinkCategory.Other));
            }
        }