Exemplo n.º 1
0
 private void LoadTagsDB()
 {
     try
     {
         Ares.Tags.ITagsDBFiles tagsDBFiles = Ares.Tags.TagsModule.GetTagsDB().FilesInterface;
         String filePath = System.IO.Path.Combine(Ares.Settings.Settings.Instance.MusicDirectory, tagsDBFiles.DefaultFileName);
         // if reading from a smb share, copy the database to a local file since SQLite can't open databases from input streams or memory bytes
         if (filePath.IsSmbFile())
         {
             String cacheFileName = System.IO.Path.GetTempFileName();
             try
             {
                 using (var ifs = new System.IO.BufferedStream(SambaHelpers.GetSambaInputStream(filePath)))
                     using (var ofs = System.IO.File.Create(cacheFileName))
                     {
                         ifs.CopyTo(ofs);
                     }
             }
             catch (System.IO.IOException ioEx)
             {
                 LogException(ioEx);
                 ShowToast(String.Format(Resources.GetString(Resource.String.tags_db_error), ioEx.Message));
                 return;
             }
             filePath = cacheFileName;
         }
         tagsDBFiles.OpenOrCreateDatabase(filePath);
     }
     catch (Ares.Tags.TagsDbException ex)
     {
         LogException(ex);
         ShowToast(String.Format(Resources.GetString(Resource.String.tags_db_error), ex.Message));
     }
 }
Exemplo n.º 2
0
 private void LoadTagsDB()
 {
     try
     {
         Ares.Tags.ITagsDBFiles tagsDBFiles = Ares.Tags.TagsModule.GetTagsDB().FilesInterface;
         String path = System.IO.Path.Combine(Ares.Settings.Settings.Instance.MusicDirectory, tagsDBFiles.DefaultFileName);
         tagsDBFiles.OpenOrCreateDatabase(path);
     }
     catch (Ares.Tags.TagsDbException ex)
     {
         Console.WriteLine(String.Format(StringResources.TagsDbError, ex.Message));
     }
 }
Exemplo n.º 3
0
 private void LoadTagsDB()
 {
     try
     {
         Ares.Tags.ITagsDBFiles tagsDBFiles = Ares.Tags.TagsModule.GetTagsDB().FilesInterface;
         String path = System.IO.Path.Combine(Ares.Settings.Settings.Instance.MusicDirectory, tagsDBFiles.DefaultFileName);
         tagsDBFiles.OpenOrCreateDatabase(path);
         Ares.Editor.Actions.TagChanges.Instance.FireTagsDBChanged(this);
     }
     catch (Ares.Tags.TagsDbException ex)
     {
         MessageBox.Show(this, String.Format(StringResources.TagsDbError, ex.Message), StringResources.Ares, MessageBoxButtons.OK, MessageBoxIcon.Error);
     }
 }