Exemplo n.º 1
0
        public virtual bool ContentEquals(LyricsForSongContract contract)
        {
            if (contract == null)
            {
                return(false);
            }

            return(Language == contract.Language && Source == contract.Source && Value == contract.Value);
        }
Exemplo n.º 2
0
        public LyricsForSongModel(LyricsForSongContract contract)
            : this()
        {
            ParamIs.NotNull(() => contract);

            Id       = contract.Id;
            Language = contract.Language;
            Source   = contract.Source;
            Value    = contract.Value;
        }
Exemplo n.º 3
0
        public virtual bool ContentEquals(LyricsForSongContract contract)
        {
            if (contract == null)
            {
                return(false);
            }

            return(TranslationType == contract.TranslationType &&
                   CultureCode.CultureCode == contract.CultureCode &&
                   Source == contract.Source &&
                   URL == contract.URL &&
                   Value == contract.Value);
        }
Exemplo n.º 4
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.º 5
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.º 6
0
 public virtual LyricsForSong CreateLyrics(LyricsForSongContract lyrics)
 {
     ParamIs.NotNull(() => lyrics);
     return(CreateLyrics(lyrics.Value, lyrics.Source, lyrics.URL, lyrics.TranslationType, lyrics.CultureCode));
 }
Exemplo n.º 7
0
        public PartialViewResult CreateLyrics()
        {
            var entry = new LyricsForSongContract();

            return(PartialView("LyricsForSongEditRow", new LyricsForSongModel(entry)));
        }
Exemplo n.º 8
0
 public LyricsInfoViewModel(LyricsForSongContract lyrics)
 {
     Lyrics = lyrics;
 }