Пример #1
0
        public static SongDifference operator -(Song x, Song y)
        {
            var diff = new SongDifference(x.ID)
            {
                Title           = GetComparison(x.Title, y.Title),
                AlbumArt        = GetComparison(x.AlbumArt, y.AlbumArt),
                Artist          = GetComparison(x.Artist, y.Artist),
                Album           = GetComparison(x.Album, y.Album),
                AlbumArtist     = GetComparison(x.AlbumArtist, y.AlbumArtist),
                TitleNorm       = GetComparison(x.TitleNorm, y.TitleNorm),
                ArtistNorm      = GetComparison(x.ArtistNorm, y.ArtistNorm),
                AlbumNorm       = GetComparison(x.AlbumNorm, y.AlbumArtistNorm),
                AlbumArtistNorm = GetComparison(x.AlbumNorm, y.AlbumArtistNorm),
                Composer        = GetComparison(x.Composer, y.Composer), //10
                Genre           = GetComparison(x.Genre, y.Genre),
                //Duration = GetComparison(x.Duration, y.Duration),
                Track = GetComparison(x.Track, y.Track),
                //TotalTracks = GetComparison(x.TotalTracks, y.TotalTracks),
                Disc = GetComparison(x.Disc, y.Disc),
                //TotalDiscs = GetComparison(x.TotalDiscs, y.TotalDiscs),
                Year              = GetYearComparison(x.Year, y.Year),
                IsDeleted         = GetComparison(x.IsDeleted, y.IsDeleted),
                PermanentlyDelete = GetComparison(x.PermanentlyDeleted, y.PermanentlyDeleted), //20
                Pending           = GetComparison(x.Pending, y.Pending),
                //Playcount = GetComparison(x.Playcount, y.Playcount),
                //Rating = GetComparison(x.Rating, y.Rating),
                //CreationDate = GetComparison(x.CreationDate, y.CreationDate),
                //LastPlayed = GetComparison(x.LastPlayed, y.LastPlayed),
                SubjectToCuration = GetComparison(x.SubjectToCuration, y.SubjectToCuration),
                //StoreID = GetComparison(x.StoreID, y.StoreID),
                MatchedID = GetComparison(x.MatchedID, y.MatchedID),
                //Type = GetComparison(x.Type, y.Type),
                Comment         = GetComparison(x.Comment, y.Comment), // 30
                FixMatchNeeded  = GetComparison(x.FixMatchNeeded, y.FixMatchNeeded),
                MatchedAlbumId  = GetComparison(x.MatchedAlbumId, y.MatchedAlbumId),
                MatchedArtistId = GetComparison(x.MatchedArtistId, y.MatchedArtistId),
                //Bitrate = GetComparison(x.Bitrate, y.Bitrate),
                ArtURL   = GetComparison(x.ArtURL, y.ArtURL), // 36
                Explicit = GetComparison(x.Explicit, y.Explicit),
            };

            return(diff);
        }
Пример #2
0
 public void ApplyDiff(SongDifference diff)
 {
     if (diff.ID != null)
     {
         this.ID = diff.ID;
     }
     if (diff.Title != null)
     {
         this.Title = diff.Title;
     }
     if (diff.AlbumArt != null)
     {
         this.AlbumArt = diff.AlbumArt;
     }
     if (diff.Artist != null)
     {
         this.Artist = diff.Artist;
     }
     if (diff.Album != null)
     {
         this.Album = diff.Album;
     }
     if (diff.AlbumArtist != null)
     {
         this.AlbumArtist = diff.AlbumArtist;
     }
     if (diff.TitleNorm != null)
     {
         this.TitleNorm = diff.TitleNorm;
     }
     if (diff.ArtistNorm != null)
     {
         this.ArtistNorm = diff.ArtistNorm;
     }
     if (diff.AlbumNorm != null)
     {
         this.AlbumNorm = diff.AlbumNorm;
     }
     if (diff.AlbumArtistNorm != null)
     {
         this.AlbumArtistNorm = diff.AlbumArtistNorm;
     }
     if (diff.Composer != null)
     {
         this.Composer = diff.Composer;
     }
     if (diff.Genre != null)
     {
         this.Genre = diff.Genre;
     }
     if (diff.Track != null)
     {
         this.Track = diff.Track.Value;
     }
     if (diff.Disc != null)
     {
         this.Disc = diff.Disc.Value;
     }
     if (diff.Year != null)
     {
         this.Year = diff.Year;
     }
     if (diff.IsDeleted != null)
     {
         this.IsDeleted = diff.IsDeleted.Value;
     }
     if (diff.PermanentlyDelete != null)
     {
         this.PermanentlyDeleted = diff.PermanentlyDelete;
     }
     if (diff.Pending != null)
     {
         this.Pending = diff.Pending;
     }
     if (diff.SubjectToCuration != null)
     {
         this.SubjectToCuration = diff.SubjectToCuration;
     }
     if (diff.MatchedID != null)
     {
         this.MatchedID = diff.MatchedID;
     }
     if (diff.Comment != null)
     {
         this.Comment = diff.Comment;
     }
     if (diff.MatchedAlbumId != null)
     {
         this.MatchedAlbumId = diff.MatchedAlbumId;
     }
     if (diff.MatchedArtistId != null)
     {
         this.MatchedArtistId = diff.MatchedArtistId;
     }
     if (diff.Bitrate != null)
     {
         this.Bitrate = diff.Bitrate.Value;
     }
     if (diff.ArtURL != null)
     {
         this.ArtURL = diff.ArtURL;
     }
     if (diff.Explicit != null)
     {
         this.Explicit = (bool)diff.Explicit;
     }
 }