Skip to content

Commit

Permalink
fix: upgrade PIL
Browse files Browse the repository at this point in the history
  • Loading branch information
elibroftw committed Apr 9, 2024
1 parent fd78bc1 commit c12a109
Show file tree
Hide file tree
Showing 12 changed files with 80 additions and 100 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
Music Caster by Elijah Lopez Changelog

5.18.1
- [Fix] Security update
- [Fix] Play AIFF from explorer

5.18.0
- [Feat] Local support for AIFF?

Expand Down
7 changes: 2 additions & 5 deletions build_files/TkinterDnD2/TkinterDnD.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,8 @@
Tk window and all its descendants."""

try:
# noinspection PyPep8Naming
import Tkinter as tkinter
# noinspection PyPep8Naming
import Tix as tix
import Tkinter as tkinter # type: ignore
import Tix as tix # type: ignore
except ImportError:
import tkinter
from tkinter import tix
Expand Down Expand Up @@ -73,7 +71,6 @@ class DnDEvent:
pass


# noinspection PyUnresolvedReferences,PyPep8Naming
class DnDWrapper:
"""Internal class."""
# some of the percent substitutions need to be enclosed in braces
Expand Down
9 changes: 4 additions & 5 deletions build_files/mc_version_info.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
# UTF-8
# For more details about fixed file info 'ffi' see: http://msdn.microsoft.com/en-us/library/ms646997.aspx
# noinspection PyUnresolvedReferences
VSVersionInfo(
ffi=FixedFileInfo(
prodvers=(5, 18, 0, 0),
filevers=(5, 18, 0, 0),
prodvers=(5, 18, 1, 0),
filevers=(5, 18, 1, 0),
# Contains a bitmask that specifies the valid bits 'flags'r
mask=0x17,
# Contains a bitmask that specifies the Boolean attributes of the file.
Expand All @@ -28,12 +27,12 @@ VSVersionInfo(
'000004b0',
[StringStruct('CompanyName', 'Elijah Lopez'),
StringStruct('FileDescription', 'Music Caster'),
StringStruct('FileVersion', '5.18.0.0'),
StringStruct('FileVersion', '5.18.1.0'),
StringStruct('InternalName', 'Music Caster'),
StringStruct('LegalCopyright', 'Copyright (c) 2019 - 2024, Elijah Lopez'),
StringStruct('OriginalFilename', 'Music Caster.exe'),
StringStruct('ProductName', 'Music Caster'),
StringStruct('ProductVersion', '5.18.0.0')])
StringStruct('ProductVersion', '5.18.1.0')])
]),
VarFileInfo([VarStruct('Translation', [0, 1200])])
]
Expand Down
1 change: 0 additions & 1 deletion build_files/mcu_version_info.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# UTF-8
# noinspection PyUnresolvedReferences
VSVersionInfo(
ffi=FixedFileInfo(
prodvers=(2, 3, 0, 0),
Expand Down
8 changes: 2 additions & 6 deletions build_files/onedir.spec
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
# -*- mode: python ; coding: utf-8 -*-
import os
from glob import iglob
# noinspection PyPackageRequirements
from PyInstaller.building.api import PYZ, EXE, COLLECT
# noinspection PyPackageRequirements
from PyInstaller.building.build_main import Analysis, Tree
# noinspection PyPackageRequirements
from PyInstaller.building.build_main import Analysis, Tree # type: ignore
from PyInstaller.config import CONF
import platform

CONF['distpath'] = './src/dist'
CONF['distpath'] = './src/dist' # type: ignore
block_cipher = None
# CONF['workpath'] = './build'
# TODO: test on MAC OSX
Expand Down
7 changes: 2 additions & 5 deletions build_files/portable.spec
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# -*- mode: python ; coding: utf-8 -*-
import os
# noinspection PyPackageRequirements
from PyInstaller.building.api import PYZ, EXE
# noinspection PyPackageRequirements
from PyInstaller.building.build_main import Analysis, Tree
# noinspection PyPackageRequirements
from PyInstaller.building.build_main import Analysis, Tree # type: ignore
from PyInstaller.config import CONF
import platform

CONF['distpath'] = './src/dist'
CONF['distpath'] = './src/dist' # type: ignore
# CONF['workpath'] = './build'
block_cipher = None
a = Analysis([f'{os.getcwd()}/src/music_caster.py'],
Expand Down
2 changes: 1 addition & 1 deletion build_files/setup_script.iss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#define MyAppName "Music Caster"
#define MyAppVersion "5.18.0"
#define MyAppVersion "5.18.1"
#define MyAppPublisher "Elijah Lopez"
#define MyAppURL "https://elijahlopez.ca/software#music-caster"
#define MyAppExeName "Music Caster.exe"
Expand Down
11 changes: 3 additions & 8 deletions build_files/updater.spec
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
# -*- mode: python ; coding: utf-8 -*-
import os
import sys
# noinspection PyPackageRequirements
from PyInstaller.building.api import PYZ, EXE
# noinspection PyPackageRequirements
from PyInstaller.building.build_main import Analysis
# noinspection PyPackageRequirements
from PyInstaller.config import CONF

CONF['distpath'] = './dist'
CONF['workpath'] = './_build'
CONF['distpath'] = './dist' # type: ignore
CONF['workpath'] = './_build' # type: ignore
block_cipher = None
# noinspection PyTypeChecker
sys.modules['FixTk'] = None
sys.modules['FixTk'] = None # type: ignore
a = Analysis([f'{os.getcwd()}/updater.py'],
pathex=[os.getcwd()],
binaries=[],
Expand Down Expand Up @@ -46,7 +42,6 @@ exe = EXE(pyz,
icon=os.path.abspath('resources/Updater.ico'),
version='mcu_version_info.txt')
# ONLY USE FOR DEBUGGING
# noinspection PyUnresolvedReferences
# coll = COLLECT(exe,
# a.binaries - TOC([('libcrypto-1_1.dll', None, None)]),
# a.zipfiles,
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ pgi; sys_platform == 'linux'
testresources; sys_platform == 'linux'
ujson~=5.5
mutagen~=1.45
Pillow~=10.2.0
Pillow~=10.3.0
PyChromecast~=14.0
zeroconf~=0.37
pynput~=1.4.5
Expand Down
3 changes: 2 additions & 1 deletion src/meta.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION = latest_version = '5.18.0'
VERSION = latest_version = '5.18.1'
UPDATE_MESSAGE = """
[NEW] Better Error Capturing
[MSG] Language translators wanted
Expand Down Expand Up @@ -55,6 +55,7 @@
# re-define AUDIO_EXTS
AUDIO_EXTS = {f'.{ext}' for ext in AUDIO_EXTS}
AUDIO_EXTS.add('.m3u')
AUDIO_HANDLER_EXTS = ('mp3', 'flac', 'm4a', 'aac', 'ogg', 'opus', 'aiff', 'wma', 'wav', 'mpeg', 'm3u', 'm3u8')

FONT_NORMAL = 'Segoe UI', 11
FONT_SMALL = 'Segoe UI', 10
Expand Down
18 changes: 5 additions & 13 deletions src/music_caster.py
Original file line number Diff line number Diff line change
@@ -1,19 +1,15 @@
# flake8: noqa: E402
from meta import *
import time
start_time = time.monotonic()
# noinspection PyUnresolvedReferences
from contextlib import suppress
from itertools import islice
# noinspection PyUnresolvedReferences
import io
import multiprocessing as mp
import os
# noinspection PyUnresolvedReferences
import platform
import threading
# noinspection PyUnresolvedReferences
from subprocess import Popen, PIPE, DEVNULL
# noinspection PyUnresolvedReferences
from subprocess import Popen, PIPE, DEVNULL # noqa
import re
import sys
from shared import is_already_running
Expand Down Expand Up @@ -158,8 +154,7 @@ def activate_instance(port=2001, default_timeout=0.5, to_port=2004):
import concurrent.futures
from collections import deque
from collections.abc import Iterable
# noinspection PyUnresolvedReferences
import encodings.idna # DO NOT REMOVE
import encodings.idna # noqa # DO NOT REMOVE
from functools import cmp_to_key
import hashlib
from copy import deepcopy
Expand All @@ -183,10 +178,10 @@ def activate_instance(port=2001, default_timeout=0.5, to_port=2004):

from audio_player import AudioPlayer
from utils import *
from modules.resolution_switcher import fmt_res, get_all_resolutions, set_resolution, get_all_refresh_rates, get_initial_res, is_plugged_in, get_initial_dpi_scale
get_initial_dpi_scale()
from gui import MainWindow, MiniPlayerWindow, focus_window
import PySimpleGUI as Sg
from modules.resolution_switcher import set_resolution, get_all_refresh_rates, get_initial_res, is_plugged_in
from modules.db import DatabaseConnection, init_db

# 0.5 seconds gone to 3rd party imports
Expand Down Expand Up @@ -241,8 +236,7 @@ def activate_instance(port=2001, default_timeout=0.5, to_port=2004):
settings_file_lock = threading.Lock()
last_play_command = settings_last_modified = 0
update_last_checked = time.time() # check every hour
# noinspection PyTypeChecker
cast: Chromecast = None
cast: Chromecast = None # type: ignore
all_tracks, url_metadata, all_tracks_sorted = {}, {}, []
tray_playlists = [t('Playlists Tab')]
CHECK_MARK = '✓'
Expand Down Expand Up @@ -1070,7 +1064,6 @@ def api_get_dz():
range_header = {'Range': request.headers.get('Range', 'bytes=0-')}
r = requests.get(file_url, headers=range_header, stream=True)
start_bytes = int(range_header['Range'].split('=', 1)[1].split('-', 1)[0])
# noinspection PyProtectedMember
blowfish_key = metadata['bf_key']
iv = b'\x00\x01\x02\x03\x04\x05\x06\x07'

Expand Down Expand Up @@ -1553,7 +1546,6 @@ def ydl_get_metadata(item, duration_helper=True):
metadata['art'] = item['thumbnail']
return metadata

# noinspection PyTypeChecker
def get_url_metadata(url, fetch_art=True) -> list:
# TODO: move to utils.py and add parameter url_metadata_cache
"""
Expand Down
Loading

0 comments on commit c12a109

Please sign in to comment.