Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Elementum 0.1.106 crash/restarts when integrating library #1085

Open
siwyroot opened this issue Nov 14, 2024 · 11 comments
Open

Elementum 0.1.106 crash/restarts when integrating library #1085

siwyroot opened this issue Nov 14, 2024 · 11 comments

Comments

@siwyroot
Copy link

Every time I try to integrate elementum library with kodi, elementum restarts.

Expected Behavior

integrate library with kodi

Current Behavior

elementum plugin crash

Steps to Reproduce (for bugs)

  1. Install elementum
  2. Go to Setting -> General
  3. Select "Open directory with Kodi file browser"
  4. Elementum restarts

Your Environment

  • Version used:
    Kodi 21.1
  • Environment name and version:
    Elementum 0.1.106
  • Operating System and version:
    Fedora 40
2024-11-14 19:23:38.409 T:1382     info <general>: CActiveAESink::OpenSink - initialize sink
2024-11-14 19:23:38.409 T:1382     info <general>: CAESinkALSA::Initialize - Attempting to open device "@:CARD=Intel,DEV=0"
2024-11-14 19:23:38.419 T:1382     info <general>: CAESinkALSA::Initialize - Opened device "sysdefault:CARD=Intel"
2024-11-14 19:23:38.419 T:1382     info <general>: CAESinkALSA::InitializeHW - Your hardware does not support AE_FMT_FLOAT, trying other formats
2024-11-14 19:23:38.419 T:1382     info <general>: CAESinkALSA::InitializeHW - Using data format AE_FMT_S16NE
2024-11-14 19:23:43.567 T:1313    error <general>: Control 55 in window 10025 has been asked to focus, but it can't
2024-11-14 19:23:43.922 T:1406     info <general>: JSONRPC Server: New connection added
2024-11-14 19:23:43.923 T:1406     info <general>: JSONRPC Server: Disconnection detected
2024-11-14 19:23:43.925 T:1412  warning <general>: [plugin.video.elementum] [GIN] 2024/11/14 - 19:23:43 | 200 |    2.942513ms |   2.6 kB |       127.0.0.1 | GET      "/?doresume=false"
2024-11-14 19:23:46.544 T:1412  warning <general>: [plugin.video.elementum] [GIN] 2024/11/14 - 19:23:46 | 200 |    1.875619ms |      0 B |       127.0.0.1 | GET      "/settings/plugin.video.elementum?doresume=false"
2024-11-14 19:23:46.594 T:33925   error <general>: GetDirectory - Error getting plugin://plugin.video.elementum/settings/plugin.video.elementum
2024-11-14 19:23:58.909 T:1313  warning <general>: CGUIWindowManager - HandleAction - ignoring action 107, because topmost modal dialog closing animation is running
@siwyroot
Copy link
Author

Tested on both VM and read system. If needed I can rebuild this system multiple times for testing.

@elgatito
Copy link
Owner

@siwyroot It is impossible to see the error without full log file.

@siwyroot
Copy link
Author

Here is full log but rest is just plugin startup
kodi.log

@siwyroot siwyroot reopened this Nov 14, 2024
@siwyroot
Copy link
Author

I captured log in moment when I clicked "Open directory with Kodi file browser"

@antonsoroko
Copy link

antonsoroko commented Nov 15, 2024

tried on ubuntu 24.04 and flatpak kodi 21.1

so it works if trakt is authorized, otherwise it does not. no restart, though - but it does reload for some reason. but browser is not launched when you click the button.
at the moment - i do not see in code why this is happening.

but to be fair - it is just a "sugar" - to really configure library you need to click on path itself, not on "Open directory with Kodi file browser".

@siwyroot
Copy link
Author

For men browser do not lunch but I gest throw back to main menu and in logs it looks like elemntum reloads

@antonsoroko
Copy link

@siwyroot just to be 100% clear:
there is bug with that button, indeed. in general - we need to figure out why it is happening.

BUT you do not need to click that button to configure library integration:

but to be fair - it is just a "sugar" - to really configure library you need to click on path itself, not on "Open directory with Kodi file browser".

so you can configure elementum without waiting for a fix.

can you confirm that clicking on "path" works for you?

@antonsoroko
Copy link

antonsoroko commented Nov 16, 2024

this is outdated, read next comment.

i think i found the issue. option="close" (it will close settings window - it must be closed before opening new window) is set for those "Open directory..." buttons, and after close elementum does reload (unless trakt or opensubtitles token was changed - that's why it was working 1st time on me test environment - i authorized trakt first) and reload "interrupts" "Open directory..." command, so you do not see file browser but you see reload.

<setting type="action" label="30562" option="close" action="RunPlugin(plugin://plugin.video.elementum/cmd/open_path/library)" />

there was a logic added to ignore tokens (trakt or opensubtitles) so trakt auth process (that also uses option="close") so reload will not be initiated:
3aa2818

@antonsoroko
Copy link

antonsoroko commented Nov 16, 2024

found the real root cause: if you open settings not from elementum menu but from kodi context menu or from addons page - then button works, i think because in this case settings window is not considered as modal window , so it does not prevent showing new window.

fail when open settings from elementum's menu:

  debug <general>: [plugin.video.elementum] Requesting http://127.0.0.1:65220/cmd/open_path/download?doresume=false from ['plugin://plugin.video.elementum/cmd/open_path/download', '-1', '', 'resume:false']
warning <general>: [plugin.video.elementum] DEBU  api          ▶ OpenCustomPath   Opening /home/user/.kodi/temp/elementum_downloads in Kodi browser
warning <general>: [plugin.video.elementum] [GIN] 2024/11/16 - 14:18:45 | 200 |   37.418031ms |    18 EB |       127.0.0.1 | GET      "/cmd/open_path/download?doresume=false"
  debug <general>: Activating window ID: 10025
   info <general>: Activate of window '10025' refused because there are active modal dialogs <------- !!!

@siwyroot
Copy link
Author

@antonsoroko Thanks for explanation, I was using that button for so long that I did not consider different way. I can confirm that I can configure library by setting path button. Tanks again!

@antonsoroko
Copy link

antonsoroko commented Nov 16, 2024

if i disable reload in function onSettingsChanged() (python part of the code) - then those buttons works.

so there is some incompatibility between settings when they are in "modal dialog" mode (when they launched from elementum's menu) and "reload" process.

but i am not sure how to fix this. @elgatito maybe you can take a look into this, please.

looks like we can't use builtin functions as ListItem path here
https://github.com/elgatito/elementum/blob/638d5c307b53763e752a698252ecb03de06e085a/api/index.go#L42

i tried
Path: "Addon.OpenSettings('plugin.video.elementum')",
Path: "xbmc.executebuiltin('Addon.OpenSettings(plugin.video.elementum)')",

but looks like only paths like "plugin://" or "script://" or directly playable URL or filepath can be used as ListItem path. some info here.

so i do not know how to launch settings windows not as modal window from elementum's menu. maybe it is impossible.

maybe we can ignore reload somehow - then buttons should work in any window mode.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants