コード例 #1
0
        public static bool CheckUpdatable()
        {
            var option = SettingManager.LoadSetting <GlobalSetting>();

            try
            {
                var releases = UpdaterHelper.GetGithubAllReleaseInfoList("MikiraSora", "Wbooru");

                if (!releases.Any())
                {
                    Log.Info($"There is no any release info ,skip update check.");
                    return(false);
                }

                var updatable_releases = releases.Where(x => x.Version > CurrentProgramVersion)
                                         .OrderByDescending(x => x.Version);

                CacheUpdatableReleaseInfo = (option.UpdatableTargetVersion == GlobalSetting.UpdatableTarget.Preview ? updatable_releases.FirstOrDefault(x => x.ReleaseType == ReleaseType.Preview) : null) ?? updatable_releases.FirstOrDefault(x => x.ReleaseType == ReleaseType.Stable);

                if (CacheUpdatableReleaseInfo == null)
                {
                    Log.Info($"There is no any updatable({option.UpdatableTargetVersion}) release info ,skip update check.");
                    return(false);
                }

                return(true);
            }
            catch (Exception e)
            {
                Log.Error("Updater occured error : " + e.Message);
                return(false);
            }
        }
コード例 #2
0
 public IEnumerable <ReleaseInfo> GetReleaseInfoList()
 {
     return(UpdaterHelper.GetGithubAllReleaseInfoList("Wbooru", "WbooruPlugin.CommonMoebooruGallery"));
 }
コード例 #3
0
 public IEnumerable <ReleaseInfo> GetReleaseInfoList()
 {
     return(UpdaterHelper.GetGithubAllReleaseInfoList("Wbooru", "WbooruPlugin.Danbooru"));
 }