using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;

namespace JellyfinRPC
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            if (ConfigManager.GetEntry("DiscordClientID") != "")
            {
                var discord = new Discord.Discord(DiscordRPC.discordAppID, (UInt64)Discord.CreateFlags.Default);

#if DEBUG
                discord.SetLogHook(Discord.LogLevel.Debug, (level, message) =>
                {
                    ConsoleManager.WriteToConsole($"DiscordLog: {level} {message}");
                });
#else
                discord.SetLogHook(Discord.LogLevel.Warn, (level, message) =>
                {
                    ConsoleManager.WriteToCOnsole($"DiscordLog: {level} {message}");
                });


#endif
            } 

            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            FileChecker.FolderCheck();
            FileChecker.FileCheck();
            Application.Run(new Form1());
            ConsoleManager.WriteToConsole("Starting Jellyfin Rich Presence...");

        }
    }
}