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)); } }
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)); } }
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); } }