Updated Main
Added Path checking for validating a path to use.
This commit is contained in:
parent
595c93f50e
commit
5675ea116d
1 changed files with 15 additions and 1 deletions
|
|
@ -21,7 +21,21 @@ class Program
|
||||||
public static void Main(string[] args)
|
public static void Main(string[] args)
|
||||||
{
|
{
|
||||||
GlobalJsonOptions.Options.Converters.Add(new StringToLongJsonConverter(false));
|
GlobalJsonOptions.Options.Converters.Add(new StringToLongJsonConverter(false));
|
||||||
var path = "/home/eumario/.var/app/io.freetubeapp.FreeTube/config/FreeTube/";
|
var paths = new string[]
|
||||||
|
{
|
||||||
|
Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), ".config/FreeTube/"),
|
||||||
|
Path.Join(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile),
|
||||||
|
".var/app/io.freetubeapp.FreeTube/config/FreeTube")
|
||||||
|
};
|
||||||
|
|
||||||
|
var path = "";
|
||||||
|
|
||||||
|
foreach (var tpath in paths)
|
||||||
|
{
|
||||||
|
if (!Directory.Exists(tpath)) continue;
|
||||||
|
path = tpath;
|
||||||
|
break;
|
||||||
|
}
|
||||||
var dbWatcher = new DBSyncWatcher(path);
|
var dbWatcher = new DBSyncWatcher(path);
|
||||||
var historySyncer = new Syncer<History>(dbWatcher, Path.Join(path, "history.db"), "history.db", "/history");
|
var historySyncer = new Syncer<History>(dbWatcher, Path.Join(path, "history.db"), "history.db", "/history");
|
||||||
var playlistSyncer = new Syncer<Playlist>(dbWatcher, Path.Join(path, "playlists.db"), "playlists.db", "/playlist");
|
var playlistSyncer = new Syncer<Playlist>(dbWatcher, Path.Join(path, "playlists.db"), "playlists.db", "/playlist");
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue