Remove unused and commented out code

This commit is contained in:
Matt 2021-12-21 21:22:16 -05:00
parent 95f8dc8eb3
commit 2d20dc4282
12 changed files with 0 additions and 103 deletions

View File

@ -16,6 +16,3 @@ if log_timing_data:
log.debug("About to enter mainEntryPoint()") log.debug("About to enter mainEntryPoint()")
main_entry_point() main_entry_point()
# clear done and exit.
# sys.modules.clear()

View File

@ -43,7 +43,6 @@ class DataManager:
addon_dir = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('profile')) addon_dir = xbmc.translatePath(xbmcaddon.Addon().getAddonInfo('profile'))
def __init__(self, *args): def __init__(self, *args):
# log.debug("DataManager __init__")
pass pass
@timer @timer
@ -66,10 +65,6 @@ class DataManager:
url_hash = m.hexdigest() url_hash = m.hexdigest()
cache_file = os.path.join(self.addon_dir, "cache_" + url_hash + ".pickle") cache_file = os.path.join(self.addon_dir, "cache_" + url_hash + ".pickle")
# changed_url = url + "&MinDateLastSavedForUser=" + urllib.unquote("2019-09-16T13:45:30")
# results = self.GetContent(changed_url)
# log.debug("DataManager Changes Since Date : {0}", results)
item_list = None item_list = None
total_records = 0 total_records = 0
baseline_name = None baseline_name = None
@ -135,7 +130,6 @@ class DataManager:
cache_item.total_records = total_records cache_item.total_records = total_records
cache_thread.cached_item = cache_item cache_thread.cached_item = cache_item
# copy.deepcopy(item_list)
if not use_cache: if not use_cache:
cache_thread = None cache_thread = None
@ -171,7 +165,6 @@ class CacheManagerThread(threading.Thread):
def run(self): def run(self):
log.debug("CacheManagerThread : Started") log.debug("CacheManagerThread : Started")
# log.debug("CacheManagerThread : Cache Item : {0}", self.cached_item.__dict__)
home_window = HomeWindow() home_window = HomeWindow()
is_fresh = False is_fresh = False

View File

@ -106,13 +106,6 @@ def get_content(url, params):
url = url + "&StartIndex=" + str(start_index) + "&Limit=" + str(page_limit) url = url + "&StartIndex=" + str(start_index) + "&Limit=" + str(page_limit)
log.debug("ADDING NEXT URL: {0}".format(url_next)) log.debug("ADDING NEXT URL: {0}".format(url_next))
# use the data manager to get the data
# result = dataManager.GetContent(url)
# total_records = 0
# if result is not None and isinstance(result, dict):
# total_records = result.get("TotalRecordCount", 0)
use_cache = params.get("use_cache", "true") == "true" use_cache = params.get("use_cache", "true") == "true"
dir_items, detected_type, total_records = process_directory(url, progress, params, use_cache) dir_items, detected_type, total_records = process_directory(url, progress, params, use_cache)
@ -381,7 +374,6 @@ def process_directory(url, progress, params, use_cache_data=False):
series_url = ('{server}/Shows/' + first_season_item.series_id + series_url = ('{server}/Shows/' + first_season_item.series_id +
'/Episodes' '/Episodes'
'?userId={userid}' + '?userId={userid}' +
# '&seasonId=' + season_id +
'&IsVirtualUnAired=false' + '&IsVirtualUnAired=false' +
'&IsMissing=false' + '&IsMissing=false' +
'&Fields=SpecialEpisodeNumbers,{field_filters}' + '&Fields=SpecialEpisodeNumbers,{field_filters}' +

View File

@ -125,11 +125,9 @@ def main_entry_point():
elif mode == "WIDGET_CONTENT_CAST": elif mode == "WIDGET_CONTENT_CAST":
get_widget_content_cast(int(sys.argv[1]), params) get_widget_content_cast(int(sys.argv[1]), params)
elif mode == "SHOW_CONTENT": elif mode == "SHOW_CONTENT":
# plugin://plugin.video.jellycon?mode=SHOW_CONTENT&item_type=Movie|Series
check_server() check_server()
show_content(params) show_content(params)
elif mode == "SEARCH": elif mode == "SEARCH":
# plugin://plugin.video.jellycon?mode=SEARCH
xbmcplugin.setContent(int(sys.argv[1]), 'files') xbmcplugin.setContent(int(sys.argv[1]), 'files')
show_search() show_search()
elif mode == "NEW_SEARCH": elif mode == "NEW_SEARCH":
@ -614,7 +612,6 @@ def show_menu(params):
dialog.ok("Error", "Error getting safe delete confirmation") dialog.ok("Error", "Error getting safe delete confirmation")
elif selected_action == "show_extras": elif selected_action == "show_extras":
# "http://localhost:8096/Users/3138bed521e5465b9be26d2c63be94af/Items/78/SpecialFeatures"
u = "{server}/Users/{userid}/Items/" + item_id + "/SpecialFeatures" u = "{server}/Users/{userid}/Items/" + item_id + "/SpecialFeatures"
action_url = ("plugin://plugin.video.jellycon/?url=" + quote(u) + "&mode=GET_CONTENT&media_type=Videos") action_url = ("plugin://plugin.video.jellycon/?url=" + quote(u) + "&mode=GET_CONTENT&media_type=Videos")
built_in_command = 'ActivateWindow(Videos, ' + action_url + ', return)' built_in_command = 'ActivateWindow(Videos, ' + action_url + ', return)'

View File

@ -155,7 +155,6 @@ def add_to_playlist(play_info):
icon="special://home/addons/plugin.video.jellycon/icon.png") icon="special://home/addons/plugin.video.jellycon/icon.png")
return return
# play_session_id = id_generator()
play_session_id = playback_info.get("PlaySessionId") play_session_id = playback_info.get("PlaySessionId")
# select the media source to use # select the media source to use
@ -951,7 +950,6 @@ def prompt_for_stop_actions(item_id, data):
settings = xbmcaddon.Addon() settings = xbmcaddon.Addon()
current_position = data.get("current_position", 0) current_position = data.get("current_position", 0)
duration = data.get("duration", 0) duration = data.get("duration", 0)
# media_source_id = data.get("source_id")
next_episode = data.get("next_episode") next_episode = data.get("next_episode")
item_type = data.get("item_type") item_type = data.get("item_type")
can_delete = data.get("can_delete", False) can_delete = data.get("can_delete", False)

View File

@ -128,7 +128,6 @@ def get_server_details():
message = b"who is JellyfinServer?" message = b"who is JellyfinServer?"
multi_group = ("<broadcast>", 7359) multi_group = ("<broadcast>", 7359)
# multi_group = ("127.0.0.1", 7359)
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.settimeout(4.0) sock.settimeout(4.0)
@ -144,7 +143,6 @@ def get_server_details():
xbmc.sleep(1000) xbmc.sleep(1000)
server_count = 0 server_count = 0
# while True:
try: try:
sock.sendto(message, multi_group) sock.sendto(message, multi_group)
while True: while True:

View File

@ -130,7 +130,6 @@ def clone_skin():
def update_kodi_settings(): def update_kodi_settings():
log.debug("Settings Kodi Settings") log.debug("Settings Kodi Settings")
# set_value("screensaver.mode", "script.screensaver.logoff")
set_value("videoplayer.seekdelay", 0) set_value("videoplayer.seekdelay", 0)
set_value("filelists.showparentdiritems", False) set_value("filelists.showparentdiritems", False)
set_value("filelists.showaddsourcebuttons", False) set_value("filelists.showaddsourcebuttons", False)

View File

@ -239,7 +239,6 @@ class WebSocketClient(threading.Thread):
def run(self): def run(self):
# websocket.enableTrace(True)
download_utils = downloadutils.DownloadUtils() download_utils = downloadutils.DownloadUtils()
token = None token = None

View File

@ -1,15 +0,0 @@
$string_ids = @()
Select-String -path resources\language\resource.language.en_gb\strings.po -pattern "msgctxt " | select Line | ForEach {
$id = [regex]::match($_.Line.ToString(), '\"#([0-9]+)\"').Groups[1].Value
if($string_ids -contains $id)
{
Write-Host "ERROR: String ID Already Exists : " $id
}
else
{
$string_ids += $id
Get-ChildItem *.py,settings.xml,resources\language\resource.language.en_gb\strings.po -recurse | Select-String -pattern $id | group Pattern | where {$_.Count -eq 1} | select Name, Count
}
}

View File

@ -1,15 +0,0 @@
del /F /Q /S %HOMEPATH%\AppData\Roaming\Kodi\addons\plugin.video.jellycon
rmdir /Q /S %HOMEPATH%\AppData\Roaming\Kodi\addons\plugin.video.jellycon
xcopy /Y addon.xml %HOMEPATH%\AppData\Roaming\Kodi\addons\plugin.video.jellycon\
xcopy /Y default.py %HOMEPATH%\AppData\Roaming\Kodi\addons\plugin.video.jellycon\
xcopy /Y fanart.jpg %HOMEPATH%\AppData\Roaming\Kodi\addons\plugin.video.jellycon\
xcopy /Y icon.png %HOMEPATH%\AppData\Roaming\Kodi\addons\plugin.video.jellycon\
xcopy /Y kodi.png %HOMEPATH%\AppData\Roaming\Kodi\addons\plugin.video.jellycon\
xcopy /Y service.py %HOMEPATH%\AppData\Roaming\Kodi\addons\plugin.video.jellycon\
xcopy /E /Y resources %HOMEPATH%\AppData\Roaming\Kodi\addons\plugin.video.jellycon\resources\
cd "%programfiles%\Kodi"
kodi.exe

View File

@ -1,45 +0,0 @@
import xml.etree.ElementTree as ET
import subprocess
from shutil import copy2, copytree, rmtree
import os
import sys
package_path = "package"
def ignore_files(path, item_list):
return [".idea", ".git", ".gitignore", "scripts", package_path]
zip_path = "c:\\Program Files\\7-Zip\\7z.exe"
addon_path = sys.argv[1]
tree = ET.parse(addon_path + "\\addon.xml")
root = tree.getroot()
id = root.attrib["id"]
version = root.attrib["version"]
print (package_path + " - " + version)
try:
rmtree(package_path + "\\" + id)
except FileNotFoundError as err:
pass
copytree(addon_path, package_path + "\\" + id, ignore=ignore_files)
zip_name = id + "-" + version + ".zip"
os.chdir(package_path)
cmd_7zip = [zip_path, "a", zip_name, id]
sp = subprocess.Popen(cmd_7zip, stderr=subprocess.STDOUT, stdout=subprocess.PIPE)
sp.wait()
os.chdir("..")
copy2(package_path + "\\" + id + "\\addon.xml", package_path + "\\addon.xml")
try:
rmtree(package_path + "\\" + id)
except FileNotFoundError as err:
pass

View File

@ -6,4 +6,3 @@ extend-ignore =
I202 I202
per-file-ignores = per-file-ignores =
*/__init__.py: F401 */__init__.py: F401
scripts/process_addon.py: F821