Exemplo n.º 1
0
        public SongDetailsAjax(SongDetails model)
        {
            Id         = model.Id;
            UserRating = model.UserRating;

            var preferredLyrics = LocalizedStringHelper.GetBestMatch(model.Lyrics, Login.Manager.LanguagePreference, model.DefaultLanguageSelection);

            SelectedLyricsId = preferredLyrics != null ? preferredLyrics.Id : 0;
            SelectedPvId     = model.PrimaryPV != null ? model.PrimaryPV.Id : 0;
        }
Exemplo n.º 2
0
        public SongDetailsAjax(SongDetails model, LyricsForSongContract preferredLyrics, int version)
        {
            Id                        = model.Id;
            UserRating                = model.UserRating;
            LatestComments            = model.LatestComments;
            OriginalVersion           = model.OriginalVersion;
            PersonalDescriptionAuthor = model.PersonalDescriptionAuthor;
            PersonalDescriptionText   = model.PersonalDescriptionText;
            Version                   = version;

            SelectedLyricsId = preferredLyrics != null ? preferredLyrics.Id : 0;
            SelectedPvId     = model.PrimaryPV != null ? model.PrimaryPV.Id : 0;
            SongType         = model.SongType;
            TagUsages        = model.Tags;

            LinkedPages = model.WebLinks.Select(w => w.Url).Where(RelatedSitesHelper.IsRelatedSite).ToArray();
        }
Exemplo n.º 3
0
        public SongDetailsAjax(SongDetails model, LyricsForSongContract preferredLyrics, int version)
        {
            Id              = model.Id;
            UserRating      = model.UserRating;
            LatestComments  = model.LatestComments;
            OriginalVersion = model.OriginalVersion;
            Version         = version;

            SelectedLyricsId = preferredLyrics != null ? preferredLyrics.Id : 0;
            SelectedPvId     = model.PrimaryPV != null ? model.PrimaryPV.Id : 0;
            SongType         = model.SongType;
            TagUsages        = model.Tags;

            var domains = new[] { "http://vocadb.net/", "http://utaitedb.net/" };

            LinkedPages = model.WebLinks.Where(w => domains.Any(d => w.Url.StartsWith(d, StringComparison.InvariantCultureIgnoreCase))).Select(w => w.Url).ToArray();
        }
Exemplo n.º 4
0
        //
        // GET: /Song/Details/5
        public ActionResult Details(int id = invalidId)
        {
            if (id == invalidId)
                return NoId();

            WebHelper.VerifyUserAgent(Request);
            SetSearchEntryType(EntryType.Song);

            var model = new SongDetails(Service.GetSongDetails(id, WebHelper.IsValidHit(Request) ? WebHelper.GetRealHost(Request) : string.Empty));

            return View(model);
        }
Exemplo n.º 5
0
        //
        // GET: /Song/Details/5
        public ActionResult Details(int id = invalidId, int albumId = 0)
        {
            if (id == invalidId)
                return NoId();

            WebHelper.VerifyUserAgent(Request);
            SetSearchEntryType(EntryType.Song);

            var model = new SongDetails(Service.GetSongDetails(id, albumId, WebHelper.IsValidHit(Request) ? WebHelper.GetRealHost(Request) : string.Empty));
            PageProperties.Description = model.Notes;

            return View(model);
        }
Exemplo n.º 6
0
 public SongDetailsAjax(SongDetails model)
 {
     Id         = model.Id;
     UserRating = model.UserRating;
 }
Exemplo n.º 7
0
        public SongDetailsAjax(SongDetails model)
        {
            Id = model.Id;
            UserRating = model.UserRating;

            var preferredLyrics = LocalizedStringHelper.GetBestMatch(model.Lyrics, Login.Manager.LanguagePreference, model.DefaultLanguageSelection);
            SelectedLyricsId = preferredLyrics != null ? preferredLyrics.Id : 0;
            SelectedPvId = model.PrimaryPV != null ? model.PrimaryPV.Id : 0;
        }
Exemplo n.º 8
0
 public SongDetailsAjax(SongDetails model)
 {
     Id = model.Id;
     UserRating = model.UserRating;
 }