Пример #1
0
 private void Button_Click_1(object sender, RoutedEventArgs e)
 {
     SessionManager instance = SessionManager.Instance;
     instance.UserId = new Guid();
     LibraryManager lm = new LibraryManager();
     //lm.ImportSongsToLibrary("C:\\Users\\Manuel\\Desktop\\mudi");
     instance.UserId=Guid.Parse("1bbe27bd-164f-4798-9e15-6f4fb2f4bbab");
     instance.Nickname = "Majesco";
        // lm = new LibraryManager();
     //lm.ImportSongsToLibrary("C:\\Users\\Manuel\\Desktop\\mudi1");
     lm.InitializeLibrary();
     //OdysseyCloudAPIConsumer ocac =new OdysseyCloudAPIConsumer();
     //var a =ocac.GetUserAuth(new UserInfo() {Nickname = "manzumbado", Password = "******"});
     //Console.WriteLine(a);
     FileManager fm= new FileManager();
     fm.GetUserPathToOdysseyMusic();
     string reslt =fm.uploadFile(@"C:\Users\Manuel\Desktop\music\09 Eclipse.mp3");
     string result2 = fm.downloadFile(reslt);
     CrearCuenta nuevaCuenta = new CrearCuenta();
     nuevaCuenta.Show();
     this.Close();
 }
Пример #2
0
        public async void SyncUserLibrary()
        {
            
            FileManager fileManager = new FileManager();
            OdysseyCloudAPIConsumer ApiConsumer = new OdysseyCloudAPIConsumer();

            foreach (var trackInfo  in userTracks)
            {
                if (!trackInfo.isSynced)
                {
                    string fileUploadedUri = fileManager.uploadFile(trackInfo.SongPath);
                    trackInfo.isSynced = true;
                    trackInfo.songURI = fileUploadedUri;
                    trackInfo.userId = SessionManager.Instance.UserId;
                    await ApiConsumer.InsertTrackMetadata(trackInfo);
                    fileManager.uploadFile(trackInfo.SongPath);
                }
            }
        }