Пример #1
0
 private void ImportAlbumArtist(DiscogsRelease discogsRelease, DiscogsSelectImportOptions importOptionsWindow)
 {
     if (DiscogsUtility.IsVariousArtists(discogsRelease.Aggregate.JoinedArtistsFixed))
     {
         this.release.Artists.Clear();
         this.release.Artists.Add(new ReleaseArtist()
         {
             Artist = this.collectionManager.GetOrCreateArtist(DiscogsUtility.StandardVariousArtistsName)
         });
         this.release.JoinedAlbumArtists = DiscogsUtility.StandardVariousArtistsName;
     }
     else
     {
         this.release.Artists.Clear();
         foreach (var discogsArtist in discogsRelease.Artists)
         {
             this.release.Artists.Add(new ReleaseArtist()
             {
                 Artist     = this.collectionManager.GetOrCreateArtist(importOptionsWindow.FixNames ? discogsArtist.Aggregate.NameVariationFixed : discogsArtist.Aggregate.NameVariationWithFallback),
                 JoinString = discogsArtist.Join
             });
         }
         this.release.JoinedAlbumArtists = importOptionsWindow.FixNames ? discogsRelease.Aggregate.JoinedArtistsFixed : discogsRelease.Aggregate.JoinedArtists;
     }
 }
        public DiscogsSelectReleaseWindow(string initialData = null)
        {
            this.discogs = new Discogs3();

            InitializeComponent();

            int releaseId = 0;

            if (releaseId == 0 && initialData != null)
            {
                releaseId = DiscogsUtility.GetReleaseId(initialData);
            }
            if (releaseId == 0 && Clipboard.ContainsText())
            {
                releaseId = DiscogsUtility.GetReleaseId(Clipboard.GetText());
            }

            if (releaseId != 0)
            {
                textReleaseId.Text = Clipboard.GetText();
                DownloadRelease(releaseId);
            }
            else
            {
                HideRelease(StatusNoRelease);
            }
        }
        private void textBox_TextChanged(object sender, RoutedEventArgs e)
        {
            int releaseId = DiscogsUtility.GetReleaseId(this.textBox.Text);

            if (releaseId != 0)
            {
                this.textBox.SetCurrentValue(TextBox.TextProperty, releaseId.ToString());
            }
        }
        private void btnGo_Click(object sender, RoutedEventArgs e)
        {
            int releaseId = DiscogsUtility.GetReleaseId(textReleaseId.Text);

            if (releaseId == 0)
            {
                HideRelease(StatusInvalidId);
                return;
            }

            DownloadRelease(releaseId);
        }