Commit Graph

286 Commits

Author SHA1 Message Date
mani
51aaa1f603 Remove remaining problematic module-level addon access
Some checks failed
Build JellyCon / build (py2) (push) Has been cancelled
Build JellyCon / build (py3) (push) Has been cancelled
CodeQL Analysis / analyze (python, 3.9) (push) Has been cancelled
Release Drafter / Update release draft (push) Has been cancelled
Test JellyCon / test (3.9) (push) Has been cancelled
- Remove module-level addon variable in kodi_utils.py
- Load addon locally in add_menu_directory_item() where needed
- Load addon locally in SHOW_SETTINGS mode in functions.py
- Keep __addon__ fallback in functions.py for non-critical uses (__addondir__, addon_id, PLUGINPATH) which have safe fallback values
- loghandler.py already has proper exception handling around __pluginpath__ usage
2026-01-06 01:15:50 +01:00
mani
a71efe14c1 Properly fix intermittent installation failures
Some checks failed
Build JellyCon / build (py2) (push) Has been cancelled
Build JellyCon / build (py3) (push) Has been cancelled
CodeQL Analysis / analyze (python, 3.9) (push) Has been cancelled
Release Drafter / Update release draft (push) Has been cancelled
Test JellyCon / test (3.9) (push) Has been cancelled
Instead of setting addon variables to None (which causes issues),
fix the root cause by removing unnecessary module-level initialization:

- Remove module-level user_details loading in functions.py
- Load user_details locally in functions where actually needed
- Wrap remaining module-level addon access in try/except in:
  - service.py (log_timing_data)
  - default.py (log_timing_data)
  - kodi_utils.py (addon variable)
  - functions.py (__addon__ and related variables)

This prevents crashes during installation/update while avoiding
None-related issues during normal operation.
2026-01-06 01:12:59 +01:00
mani
1c75b09824 Fix context menu implementation for track selection
Some checks failed
Build JellyCon / build (py2) (push) Has been cancelled
Build JellyCon / build (py3) (push) Has been cancelled
CodeQL Analysis / analyze (python, 3.9) (push) Has been cancelled
Release Drafter / Update release draft (push) Has been cancelled
Test JellyCon / test (3.9) (push) Has been cancelled
- Remove incorrect addContextMenuItems() from item_functions.py as JellyCon uses custom context menu system
- Add "Play with track selection" entry to JellyCon's ActionMenu in show_menu() for Movies and Episodes
- Add handler for play_with_track_selection action that sets force_track_selection parameter
2026-01-06 00:55:13 +01:00
mani
b9a6b5056a Add language-based track selection and context menu
Context Menu Integration:
- Add 'Play with track selection' option to video context menus
- Available for movies and episodes via long-press/context menu
- Forces manual track selection dialog even when auto-selection is configured

Language Selection Improvements:
- Add dropdown selectors for preferred audio/subtitle languages
- Support German, English, French, Spanish, Italian, Japanese, Russian
- Add comprehensive language matching (e.g., 'ger' matches 'deu', 'deutsch', 'german')
- Add setting to auto-select 'No subtitles' when no matching subtitle found

Track Selection Scoring System:
- Audio tracks: Language match (+100), default flag (+50),
  channel count (+5-40), codec quality (+10-30), exclude commentary (-100)
- Subtitle tracks: Language match (+100), forced flag (+50),
  SRT preference (+30), default flag (+10)

Implementation Details:
- Add force_track_selection parameter throughout playback chain
- Preserve server/remote control track selections when not forcing manual selection
- Add extensive debug logging for track selection decisions
- Respect user preferences while allowing manual override via context menu
2026-01-06 00:32:44 +01:00
Hagay Goshen
de74b0a912 Code improvements
Co-authored-by: MoojMidge <56883549+MoojMidge@users.noreply.github.com>
2024-10-23 16:14:35 +03:00
Hagay Goshen
124ae358ff Fix youtube addon call for trailer playback
youtube addon maintainer says RunPlugin is an invalid way to call the addon.

So changed the call to use PlayMedia

More info on https://github.com/anxdpanic/plugin.video.youtube/issues/937
2024-10-23 10:05:14 +03:00
Seth Falco
41446bc563 fix: display media name consistently in delete dialog 2023-07-29 22:48:37 +01:00
Seth Falco
9313666fd2 fix: delete item via context menu 2023-07-29 22:38:21 +01:00
Matt
e15a87ef7f Add ability to shuffle music genres 2023-01-21 11:28:23 -05:00
Kian-Meng Ang
7efcb96921 Fix typos
Found via:
- `codespell -S *.po,*.xml`
- `typos --format brief`
2023-01-21 10:43:11 +08:00
Matt
93277c7d4f pep8 - functions.py 2023-01-14 16:47:48 -05:00
mcarlton00
f8e337ea92 Remove unnecessary headers 2023-01-12 21:05:29 -05:00
mcarlton00
347ab47672 Refactor imports to be under line length limit 2023-01-12 21:02:32 -05:00
mcarlton00
d25de226d0 Reorder imports for flake8 guidelines 2023-01-12 20:50:41 -05:00
mcarlton00
bf513dee43 Fix flake8 linting complaints 2023-01-11 19:51:26 -05:00
Matt
3dfde5eb04 Add instant mix and shuffle all features for music 2022-12-30 15:30:03 -05:00
Matt
beda70b1f9 Add play option to music video context menu 2022-10-08 16:43:57 -04:00
Matt
a69a8a269f Fix profiling for py3 2022-07-08 21:22:20 -04:00
Matt
cfc19cafc5 Add context menu play options for music 2022-06-16 19:47:11 -04:00
Matt
5534878dcd Use offscreen option when generating all listitems 2022-06-12 10:52:49 -04:00
Matt
fae51bd9b2 Remove safe delete code 2022-06-09 21:31:16 -04:00
Matt
44afd62989 Address flake8 warnings 2022-06-09 20:35:06 -04:00
Matt
5ba6291fd9 Add genre and alpha picker to music 2022-06-04 21:56:40 -04:00
Matt
643e1d2ac8 Remove trakt integration 2022-03-09 19:35:54 -05:00
Odd Stråbø
a482172be4 Utilize the new kodi_version function 2022-03-09 23:22:26 +01:00
Odd Stråbø
6126d617f5 Copy translate_path from Jf4Kodi, fix LazyLogger 2022-03-09 22:51:38 +01:00
Matt
8ba1b0b0c0 Remove unused function 2022-03-09 15:26:09 -05:00
Matt
7871422354 Optimize api initialization 2022-03-09 15:25:35 -05:00
mcarlton00
5c1842877d Remove most datamanager references 2022-03-07 19:25:44 -05:00
Matt
d02cad0fca Fix strings in functions 2022-02-27 23:52:05 -05:00
Matt
3530d158a6 More flake8 fixes 2022-02-27 23:47:31 -05:00
Matt
7eef3a30a8 Fix undefined errors 2022-02-27 23:36:01 -05:00
Matt
36b23d0b19 Reworking the network stack 2022-02-27 22:15:54 -05:00
Matt
297b25a739 Rework user data storage 2022-01-17 12:17:21 -05:00
Matt
264145c4b9 Address flake8 complaints 2021-12-30 18:40:08 -05:00
Matt
daea47bf38 More small tweaks 2021-12-30 18:13:57 -05:00
Matt
fc690abee9 Rename translate function 2021-12-30 17:05:10 -05:00
Matt
5c3740b8a9 Function refactoring and reordering 2021-12-29 16:54:05 -05:00
Matt
2d20dc4282 Remove unused and commented out code 2021-12-21 21:22:16 -05:00
Matt
8adf8a2a05 Make API calls respect limits indicated in UI 2021-10-30 18:51:38 -04:00
Matt
f42b5c2a99 Fix yes/no dialogs in kodi 19 2021-02-28 19:29:55 -05:00
Matt
8ece4ae651 Remove commented blocks of code 2021-02-14 11:14:03 -05:00
Matt
ed3087a222 String manipulations and encoding fixes 2021-01-26 22:34:51 -05:00
Matt
fb6a1c1329 Initial py3 pass 2021-01-02 23:04:24 -05:00
mcarlton00
1733e64403 Parse json payloads in centralized place 2020-11-11 22:50:26 -05:00
mcarlton00
ef3b64cf51 Merge pull request #25 from mcarlton00/castaway
Fix casting from web UI
2020-09-10 17:41:24 -04:00
Matt
8711ae2452 Fix casting from web UI 2020-09-05 17:49:18 -04:00
Matt
a90c2c2fa8 Use future strings to fix unicode errors 2020-09-05 17:29:38 -04:00
Guillaume
2e19d2eac1 Fix annoying typo "defalt" 2020-08-16 23:51:56 +02:00
Matt
a0efd1087f Copy log handler from JF for Kodi, modify for strings 2020-07-25 01:01:30 -04:00