From 992c9d5d874d798d2bf43024aad2bbeb6ddcadbb Mon Sep 17 00:00:00 2001 From: miigotu Date: Sat, 17 Feb 2024 06:59:49 -0500 Subject: [PATCH] refactor: remove pyGithub and issue submitter, remove settings for git token and username, remove links for irc, update all js dependencies STARTS FAST! Avoids error when user does not have github token set and startup can hang for 10 minutes or more! Signed-off-by: miigotu --- .github/CONTRIBUTING.md | 8 +- .snyk | 14 +- package.json | 61 ++-- pyproject.toml | 2 - sickchill/gui/slick/css/style.css | 8 - sickchill/gui/slick/js/core.js | 15 - sickchill/gui/slick/js/core.min.js | 2 +- sickchill/gui/slick/views/IRC.mako | 8 - sickchill/gui/slick/views/config.mako | 11 - sickchill/gui/slick/views/config_general.mako | 75 ----- sickchill/helper/__init__.py | 2 +- sickchill/helper/common.py | 76 +---- sickchill/locale/messages.pot | 14 - sickchill/logger.py | 170 +---------- sickchill/oldbeard/common.py | 9 +- sickchill/oldbeard/helpers.py | 5 +- sickchill/oldbeard/notifiers/plex.py | 3 +- sickchill/settings.py | 3 - sickchill/start.py | 10 +- sickchill/views/__init__.py | 1 - sickchill/views/config/general.py | 12 +- sickchill/views/irc.py | 10 - sickchill/views/logs.py | 17 -- tests/conftest.py | 3 - tests/test_config.py | 4 - tests/test_issue_submitter.py | 38 --- yarn.lock | 266 ++++++++++++------ 27 files changed, 228 insertions(+), 619 deletions(-) delete mode 100644 sickchill/gui/slick/views/IRC.mako delete mode 100644 sickchill/views/irc.py delete mode 100644 tests/test_issue_submitter.py diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index a1f55bf54a..a8b058495a 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -1,6 +1,6 @@ ### Questions about SickChill? -To get your questions answered, please ask on the [#sickchill](http://webchat.freenode.net/?channels=sickchill) IRC channel on irc.freenode.net +To get your questions answered, please ask on the [sickchill discord](https://discord.gg/FXre9qkHwE) # Contributing to SickChill @@ -17,9 +17,7 @@ The goal of this guide is to provide the best way to contribute to the official ## Discussion -If you think you've found a bug please [file it in the bug tracker](#how-to-report-bugs). - -Most of the SickChill development team can be found in the [#sickchill](http://webchat.freenode.net/?channels=sickchill) IRC channel on irc.freenode.net. +If you think you've found a bug please report it on [discord](https://discord.gg/FXre9qkHwE), where you will find most of the sickchill dev team. ## How to Report Bugs @@ -28,7 +26,7 @@ Most of the SickChill development team can be found in the [#sickchill](http://w Many bugs reported are actually issues with the user mis-understanding of how something works (there are a bit of moving parts to an ideal setup) and most of the time can be fixed by just changing some settings to fit the users needs. -If you are new to SickChill, it is usually a much better idea to ask for help first in the [SickChill IRC channel](http://webchat.freenode.net/?channels=sickchill). You will get much quicker support, and you will help avoid tying up the SickChill team with invalid bug reports. +If you are new to SickChill, it is usually a much better idea to ask for help first in the [sickchill discord](https://discord.gg/FXre9qkHwE). You will get much quicker support, and you will help avoid tying up the SickChill team with invalid bug reports. ### Try the latest version of SickChill diff --git a/.snyk b/.snyk index 2394d030e7..573c35dd21 100644 --- a/.snyk +++ b/.snyk @@ -1,15 +1,3 @@ -ignore: - 'npm:semver:20150403': - - semver@2.3.2: - reason: Waiting for official update - expires: '2015-12-21T06:00:27.961Z' - 'npm:uglify-js:20150824': - - uglify-js@2.3.6: - reason: Waiting for official update - expires: '2015-12-21T06:00:27.962Z' - 'npm:uglify-js:20151024': - - uglify-js@2.3.6: - reason: Waiting for official update - expires: '2015-12-21T06:00:27.962Z' +ignore: {} patch: {} version: v1 diff --git a/package.json b/package.json index 5d1d7c5079..05eba6e02b 100644 --- a/package.json +++ b/package.json @@ -20,17 +20,17 @@ "serve": "webpack serve" }, "devDependencies": { - "@babel/core": "^7.23.7", - "@babel/preset-env": "^7.23.7", - "@popperjs/core": "^2.11.6", - "@webpack-cli/generators": "^3.0.0", - "ava": "^6.0.1", - "babel-loader": "^9.0.0", - "bootstrap": "^5.3.1", - "bower": "^1.8.13", - "browser-env": "^3.1.0", - "copy-webpack-plugin": "^12.0.1", - "css-loader": "^6.7.1", + "@babel/core": "^7.23.9", + "@babel/preset-env": "^7.23.9", + "@popperjs/core": "^2.11.8", + "@webpack-cli/generators": "^3.0.7", + "ava": "^6.1.1", + "babel-loader": "^9.1.3", + "bootstrap": "^5.3.2", + "bower": "^1.8.14", + "browser-env": "^3.3.0", + "copy-webpack-plugin": "^12.0.2", + "css-loader": "^6.10.0", "eslint": "^8.56.0", "eslint-config-xo": "^0.44.0", "eslint-plugin-ava": "^14.0.0", @@ -38,41 +38,42 @@ "eslint-plugin-import": "^2.29.1", "eslint-plugin-no-use-extend-native": "^0.5.0", "eslint-plugin-node": "^11.1.0", - "eslint-plugin-promise": "^6.0.0", + "eslint-plugin-promise": "^6.1.1", "eslint-plugin-unicorn": "^51.0.1", - "grunt": "^1.5.2", + "grunt": "^1.6.1", "grunt-bower-concat": "git+https://github.com/miigotu/grunt-bower-concat.git", - "grunt-bower-task": "^0.6.1", - "grunt-cli": "^1.2.0", - "grunt-contrib-clean": "^2.0.0", + "grunt-bower-task": "^0.6.2", + "grunt-cli": "^1.4.3", + "grunt-contrib-clean": "^2.0.1", "grunt-contrib-copy": "^1.0.0", "grunt-contrib-cssmin": "^5.0.0", "grunt-contrib-jshint": "^3.2.0", "grunt-contrib-sass": "^2.0.0", - "grunt-contrib-uglify": "^5.2.1", - "grunt-contrib-watch": "^1.0.0", + "grunt-contrib-uglify": "^5.2.2", + "grunt-contrib-watch": "^1.1.0", "grunt-exec": "^3.0.0", "grunt-po2json": "git+https://github.com/rockykitamura/grunt-po2json.git", "html-webpack-plugin": "^5.6.0", - "jquery": "^3.2.1", + "jquery": "^3.7.1", "load-grunt-tasks": "^5.1.0", - "lodash": "^4.17.15", + "lodash": "^4.17.21", "mem-fs": "^4.0.0", "mem-fs-editor": "^11.0.0", - "mini-css-extract-plugin": "^2.6.1", - "sass": "^1.69.7", - "sass-loader": "^14.0.0", - "snyk": "^1.1266.0", - "style-loader": "^3.3.1", - "stylelint": "^16.1.0", + "mini-css-extract-plugin": "^2.8.0", + "sass": "^1.71.0", + "sass-loader": "^14.1.0", + "snyk": "^1.1280.0", + "style-loader": "^3.3.4", + "stylelint": "^16.2.1", "stylelint-config-idiomatic-order": "^10.0.0", "toml": "^3.0.0", - "webpack": "^5.76.0", - "webpack-cli": "^5.0.0", - "webpack-dev-server": "^4.11.1", + "webpack": "^5.90.2", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^5.0.2", "workbox-webpack-plugin": "^7.0.0", "xo": "^0.57.0", - "yarn-minify": "^1.0.1" + "yarn-minify": "^1.0.1", + "yarn-upgrade-all": "^0.7.2" }, "ava": { "require": [ diff --git a/pyproject.toml b/pyproject.toml index 2b3638e0fe..4e8b1bc987 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -42,7 +42,6 @@ packages = [ "Bug Tracker" = "https://github.com/sickchill/sickchill/issues" "News" = "https://raw.githubusercontent.com/SickChill/sickchill.github.io/master/sickchill-news/news.md" "Discord" = "https://discord.com/invite/U8WPBdf" -"IRC" = "https://webchat.freenode.net/?channels=#sickchill" "Donate"= "https://github.com/SickChill/SickChill/wiki/Donations" [tool.poetry.scripts] @@ -259,7 +258,6 @@ ipaddress = "^1.0.23" jsonrpclib-pelix = "^0.4.2" Mako = "^1.1.4" markdown2 = "^2.4.0" -PyGithub = ">=1.54.1,<3.0.0" pyOpenSSL = ">=20.0.1,<25.0.0" python-dateutil = "^2.8.1" python-twitter = "^3.5" diff --git a/sickchill/gui/slick/css/style.css b/sickchill/gui/slick/css/style.css index f077ffcf28..c4af2c07b6 100644 --- a/sickchill/gui/slick/css/style.css +++ b/sickchill/gui/slick/css/style.css @@ -318,10 +318,6 @@ inc_top.mako background-position: -456px 0; } -.menu-icon-irc { - background-position: -478px 0; -} - .menu-icon-changelog { background-position: -495px 0; } @@ -1936,10 +1932,6 @@ select .selected { background-position: -452px 0; } -.add-client-icon-irc { - background-position: -488px 0; -} - .add-client-icon-putio { background-position: -517px 0; } diff --git a/sickchill/gui/slick/js/core.js b/sickchill/gui/slick/js/core.js index 84aea51572..124cc0e0bc 100644 --- a/sickchill/gui/slick/js/core.js +++ b/sickchill/gui/slick/js/core.js @@ -369,21 +369,6 @@ const SICKCHILL = { } }); }); - - $('#git_token').on('click', $('#git_token').select()); - - $('#create_access_token').on('click', () => { - notifyModal( - '

Copy the generated token and paste it in the token input box.

' - + '

Provide permissions for repo:status, public_repo, write:discussion, read:discussion, user, gist, and notifications

' - + '

' - + '

'); - $('#git_token').select(); - }); - - $('#manage_tokens').on('click', () => { - window.open(anonURL + 'https://github.com/settings/tokens', '_blank'); - }); }, index() { $('#log_dir').fileBrowser({title: _('Select log file folder location')}); diff --git a/sickchill/gui/slick/js/core.min.js b/sickchill/gui/slick/js/core.min.js index 129e845f31..ba33917fe5 100644 --- a/sickchill/gui/slick/js/core.min.js +++ b/sickchill/gui/slick/js/core.min.js @@ -1 +1 @@ -function getMeta(e){return $('meta[data-var="'+e+'"]').data("content")}const scRoot=getMeta("scRoot"),scDefaultPage=getMeta("scDefaultPage"),themeSpinner=getMeta("themeSpinner"),anonURL=getMeta("anonURL"),topImageHtml='Jump to top',loading='loading';let scPID=getMeta("scPID");function configSuccess(e=!0){$(".config_submitter").each(function(){$(this).removeAttr("disabled"),$(this).next().remove(),$(this).show(),!0===e&&window.location.reload()}),$(".config_submitter_refresh").each(function(){$(this).removeAttr("disabled"),$(this).next().remove(),$(this).show()}),$("#email_show").trigger("notify"),$("#prowl_show").trigger("notify")}function metaToBool(e){let t=$('meta[data-var="'+e+'"]').data("content");return void 0===t?(console.log(e+' is empty, did you forget to add this to "main.mako"?'),t):!("false"===(t=(t=Number.isNaN(t)?t.toLowerCase():t.toString()).toLowerCase())||"none"===t||"0"===t)}function isMeta(e,t){return new RegExp(1{var t=$("#site-messages");if(void 0!==t){t.empty();for(const o in e)Object.hasOwn(e,o)&&t.append('')}}),$("#site-messages").on("click",".site-message-dismiss",function(){var e=$(this).data("id");$("#site-message-"+e).hide(),$.post(scRoot+"/ui/dismiss-site-message",{index:e})})}function shiftReturn(e){return e.length<=1?[]:(e.shift(),e)}const __=_,SICKCHILL=(window._=function(e){return e},{common:{init(){for(const e of document.querySelectorAll("img"))e.dataset.src&&e.setAttribute("src",e.dataset.src);metaToBool("settings.SICKCHILL_BACKGROUND")&&($.backstretch(scRoot+"/ui/sickchill_background"),$(".backstretch").css("opacity",getMeta("settings.FANART_BACKGROUND_OPACITY")).fadeIn("500")),addSiteMessage(),$.confirm.options={confirmButton:"Yes",cancelButton:"Cancel",dialogClass:"modal-dialog",post:!1,confirm(e){location.href=e.context.href}},$("a.shutdown").confirm({title:"Shutdown",text:"Are you sure you want to shut down SickChill?"}),$("a.restart").confirm({title:"Restart",text:"Are you sure you want to restart SickChill?"}),$("a.removeshow").confirm({title:"Remove Show",text:'Are you sure you want to remove '+$("#showtitle").data("showname")+' from the database?

 ',confirm(e){location.href=e.context.href+($("#deleteFiles")[0].checked?"&full=1":"&full=0")}}),$("a.clearhistory").confirm({title:"Clear History",text:"Are you sure you want to clear all download history?"}),$("a.trimhistory").confirm({title:"Trim History",text:"Are you sure you want to trim all download history older than 30 days?"}),$("a.submiterrors").confirm({title:"Submit Errors",text:'Are you sure you want to submit these errors ?

Make sure SickChill is updated and trigger
this error with debug enabled before submitting
'}),$("#config-components").tabs({activate(e,t){var o=$(this).data("lastOpenedPanel");o||=$(t.oldPanel),$(this).data("topPositionTab")||$(this).data("topPositionTab",$(t.newPanel).position().top),$(t.newPanel).hide().fadeIn(0),o&&o.toggleClass("ui-tabs-hide").css("position","absolute").css("top",$(this).data("topPositionTab")+"px").fadeOut(0,function(){$(this).css("position","")}),$(this).data("lastOpenedPanel",$(t.newPanel))}}),(navigator.maxTouchPoints||0)<2&&$(".dropdown-toggle").on("click",function(){var e=$(this);"true"===e.prop("ariaExpanded")&&(window.location.href=e.prop("href"))}),metaToBool("settings.FUZZY_DATING")&&($.timeago.settings.allowFuture=!0,$.timeago.settings.strings={prefixAgo:null,prefixFromNow:"In ",suffixAgo:"ago",suffixFromNow:"",seconds:"less than a minute",minute:"about a minute",minutes:"%d minutes",hour:"an hour",hours:"%d hours",day:"a day",days:"%d days",month:"a month",months:"%d months",year:"a year",years:"%d years",wordSeparator:" ",numbers:[]},$("[datetime]").timeago()),$(document.body).on("click","a[data-no-redirect]",e=>(e.preventDefault(),$.get($(e.currentTarget).prop("href")),!1)),$(document.body).on("change",".bulkCheck",e=>{const t=e.currentTarget;e="."+t.id+":visible";$(e).each(function(){this.checked=t.checked})}),$(".enabler").on("change",function(){this.checked?$("#content_"+$(this).attr("id")).fadeIn("fast","linear"):$("#content_"+$(this).attr("id")).fadeOut("fast","linear")})},QualityChooser:{setFromPresets(t){0===Number.parseInt(t,10)?$("#customQuality").show():($("#customQuality").hide(),$("#anyQualities").find("option").each(function(){var e=t&$(this).val();$(this).attr("selected",0{this.setFromPresets(e.find(":selected").val())}),this.setFromPresets(e.find(":selected").val())}},updateBlackWhiteList(e){$("#pool").children().remove(),$("#anime").is(":checked")?($("#blackwhitelist").show(),e&&$.getJSON(scRoot+"/home/fetch_releasegroups",{show_name:e},e=>{"success"===e.result&&$.each(e.groups,(e,t)=>{var o=$(""):$("#pushbullet_device_list").append('"));$("#pushbullet_device_list").prepend('"),t&&$("#testPushbullet-result").html(t)}),$("#pushbullet_device_list").on("change",()=>{$("#pushbullet_device").val($("#pushbullet_device_list").val()),$("#testPushbullet-result").html(_("Don't forget to save your new pushbullet settings."))}),$.post(scRoot+"/home/getPushbulletChannels",{api:o.api},e=>{if(o.channels=$.parseJSON(e).channels,o.currentChannel=$("#pushbullet_channel").val(),$("#pushbullet_channel_list").html(""),0'+o.channels[e].name+""):$("#pushbullet_channel_list").append('");$("#pushbullet_channel_list").prepend('"),$("#pushbullet_channel_list").prop("disabled",!1)}else $("#pushbullet_channel_list").prepend(''),$("#pushbullet_channel_list").prop("disabled",!0);t&&$("#testPushbullet-result").html(t),$("#pushbullet_channel_list").on("change",()=>{$("#pushbullet_channel").val($("#pushbullet_channel_list").val()),$("#testPushbullet-result").html(_("Don't forget to save your new pushbullet settings."))})})):($("#testPushbullet-result").html(_("You didn't supply a Pushbullet api key")),$("#pushbullet_api").focus())}function t(){$.getJSON(scRoot+"/home/loadShowNotifyLists",t=>{if(0!==t._size){var o=[];for(const a in t)Object.hasOwn(t,a)&&"_"!==a.charAt(0)&&o.push(t[a]);var s=o.sort((e,t)=>e.namet.name?1:0);let e='';for(const i in s)Object.hasOwn(s,i)&&s[i].id&&s[i].name&&(e+='