LostLightProjects / jellyfin-skill

Fork of Emby skill for playing songs from Jellyfin
GNU General Public License v2.0
7 stars 5 forks source link

Initial port to the OVOS skill API #9

Closed strugee closed 1 year ago

strugee commented 1 year ago

This patchset gets the skill installing on Neon systems and presumably on OVOS systems too. I installed with pip install git+https://github.com/strugee/jellyfin-skill.git@ovos-port for testing.

I did very minimal testing on this - essentially just tailing the logfiles to ensure that there weren't any exceptions thrown or anything (and to start squashing the deprecation warnings).

Ref #6

strugee commented 1 year ago

Confirmed that this branch at least responds to "play from Jellyfin".

strugee commented 1 year ago

Note to self: still need to compare this code with a newly generated project and see what else needs changing/porting over

strugee commented 1 year ago

Forgot to mention that this branch is at least somewhat working (play <song> from Jellyfin does the right thing) on my Mark II. However play <song> does not seem to be working properly.

ghostbuster84 commented 1 year ago

I finally have time to take a look at this, and I went ahead and merged your commits. Hopefully everything works alright. I will be using OVOS and focusing on that instead of NEON. I'm looking forward to getting back into this!

strugee commented 1 year ago

Hopefully everything works alright.

I suspect it'll work on OVOS, but it's gotten borked on Neon because apparently ovos_audio is internal API and Neon ships a different module - apparently there's a lot more work to be done here.

See https://matrix.to/#/!HhLBuodkbodKsHKufb:matrix.org/$bZ-6O_N4GderfTPoZvfd702C9WGZPVSXEegh41L4ZNo?via=strugee.net&via=matrix.org

strugee commented 1 year ago

Thanks for merging though :-)

develroo commented 11 months ago

BUMP

What is the status of this port? I have a NeonAI running on a MKII and happy to test it for bugs and compatibility as I have an extensive Jelllyfin set up covering Movies, TV, Music, AudioBook etc

Thanks.

ghostbuster84 commented 11 months ago

As far as I know, it's working on other people's devices, but personally, due to this crappy economy (let's go brandon), I've been working 2 jobs trying to make money and trying to make time for family and the important things in life. I've kinda let go of all my project endeavors when it come to the IOT world. Maybe one day I'll resume, but it's not likely anytime soon.

develroo commented 8 months ago

FWIW It still is not working for me.

2024-03-11 07:22:09.853 - jellyfin-skill.lostlightprojects - INFO - {'utterances': ['play elivis from jellyfin'], 'lang': 'en-us', 'media': 'elivis', 'utterance': 'play elivis from jellyfin'}
2024-03-11 07:22:10.369 - skills - ovos_utils.file_utils:resolve_resource_file:166 - WARNING - Deprecation version=0.1.0. Caller=ovos_utils.dialog:166. Expected a dict config and got None.
2024-03-11 07:22:10.534 - jellyfin-skill.lostlightprojects - ERROR - can only concatenate str (not "NoneType") to str
Traceback (most recent call last):
  File "/home/neon/venv/lib/python3.10/site-packages/ovos_utils/events.py", line 78, in wrapper
    handler(message)
  File "/home/neon/.local/share/neon/skills/jellyfin-skill.lostlightprojects/__init__.py", line 111, in handle_jellyfin
    if not self.connect_to_jellyfin():
  File "/home/neon/.local/share/neon/skills/jellyfin-skill.lostlightprojects/__init__.py", line 90, in connect_to_jellyfin
    self.log.debug("Testing connection to: " + self.settings.get("hostname"))
TypeError: can only concatenate str (not "NoneType") to str
2024-03-11 07:28:26.521 - skills - neon_core.skills.intent_service:handle_utterance:261 - INFO - lang=en-us ['play jailhouse rock from jellyfin']
2024-03-11 07:28:26.748 - jellyfin-skill.lostlightprojects - INFO - {'utterances': ['play jailhouse rock from jellyfin'], 'lang': 'en-us', 'media': 'jailhouse rock', 'utterance': 'play jailhouse rock from jellyfin'}
2024-03-11 07:28:26.770 - skills - ovos_utils.file_utils:resolve_resource_file:166 - WARNING - Deprecation version=0.1.0. Caller=ovos_utils.dialog:166. Expected a dict config and got None.
2024-03-11 07:28:26.958 - jellyfin-skill.lostlightprojects - ERROR - can only concatenate str (not "NoneType") to str
Traceback (most recent call last):
  File "/home/neon/venv/lib/python3.10/site-packages/ovos_utils/events.py", line 78, in wrapper
    handler(message)
  File "/home/neon/.local/share/neon/skills/jellyfin-skill.lostlightprojects/__init__.py", line 111, in handle_jellyfin
    if not self.connect_to_jellyfin():
  File "/home/neon/.local/share/neon/skills/jellyfin-skill.lostlightprojects/__init__.py", line 90, in connect_to_jellyfin
    self.log.debug("Testing connection to: " + self.settings.get("hostname"))
TypeError: can only concatenate str (not "NoneType") to str
strugee commented 8 months ago

Your config file is likely missing a hostname key.

develroo commented 8 months ago

Nope.. The hostname key is there and I tried IP address, hostname, adding hostnames to /etc/hosts. Still the same.

This is the settings.json. Nothing really sensitive in it, as it is only locally accessible.

{
    "jellyfin": {
        "Server": {
            "hostname": "http://miniforn",
            "port": "8096",
            "user": "neon",
            "password": "N30n!"
        }
    }
}
strugee commented 8 months ago

Not sure. Apparently I've reset my Neon since I last had this working. /etc/hosts has nothing to do with it FWIW.

Maybe try without the Server wrapper? That seems suspicious. Like this:

{
    "jellyfin": {
        "hostname": "http://miniforn",
        "port": "8096",
        "user": "neon",
        "password": "N30n!"
    }
}

Or maybe lowercase server. I'm just not sure.

develroo commented 8 months ago

Edit: oh I see what you mean. Sorry,

Edit2:

Nope that did not seem to help. When running test jellyfin

2024-03-14 13:39:26.919 - jellyfin-skill.lostlightprojects - ERROR - can only concatenate str (not "NoneType") to str
Traceback (most recent call last):
  File "/home/neon/venv/lib/python3.10/site-packages/ovos_utils/events.py", line 78, in wrapper
    handler(message)
  File "/home/neon/venv/lib/python3.10/site-packages/jellyfin_skill/__init__.py", line 255, in handle_diagnostic
    self.connect_to_jellyfin(diagnostic=True)
  File "/home/neon/venv/lib/python3.10/site-packages/jellyfin_skill/__init__.py", line 90, in connect_to_jellyfin
    self.log.debug("Testing connection to: " + self.settings.get("hostname"))
TypeError: can only concatenate str (not "NoneType") to str