bigretromike / nakamori

Nakamori is Kodi addon that use Shoko (known as Japanese Media Manager (JMM)) Server as back-end for metadata information.
https://shokunin.monogatari.pl/nakamori/
48 stars 5 forks source link

A lot of stuff needs reverted/changed #370

Closed da3dsoul closed 2 years ago

da3dsoul commented 5 years ago

I've been busy with life, so I'm not faulting you here, but some of the changes recently are just bad design, if they even work, as they might be causing serious issues behind the scenes.

First, the routes that I painstakenly put in after many hours of work. They'll need to be fixed. For this one, it's multiple issues, mostly on Kodi's side. We don't do weird hyphenated URLs.

Second,

@routing_plugin.route('/filter-<parent_id>/filter-<filter_id>/group-<group_id>/series-<series_id>/')
@routing_plugin.route('/filter-<filter_id>/group-<group_id>/series-<series_id>/')
@routing_plugin.route('/menu-<menu_name>/series-<series_id>/')
@routing_plugin.route('/menu-search/<query>/series-<series_id>/')
@routing_plugin.route('/menu-azsearch/<query>/series-<series_id>/')

is not good. Each of those nests inside each other with the way that that works. Make separate functions with different arguments that call one internal function to solve that issue. It is stacked with try_function on purpose to take advantage of the way it nests.

Third, don't add a trailing slash, as that will be stripped with a new commit to Kodi and kodi-plugin-routing. It was a good idea that used to work, but it won't soon.

Forth,

@routing_plugin.route('/menu-azsearch/')
@routing_plugin.route('/menu-azsearch/<character>/')
@try_function(ErrorPriority.BLOCKING, except_func=fail_menu)
def az_search(character=''):
    from shoko_models.v2 import CustomItem, Group, Series
    from string import ascii_lowercase

    if character == '':
        for c in ascii_lowercase:
            item = CustomItem('%s%s' % (character, c), 'search.png', url_for(az_search, '%s%s' % (character, c)))
            item.is_kodi_folder = False
            plugin_dir.append(item.get_listitem())

    elif character != '':

Going along with what I said about the nesting, this would be better split into separate functions anyway, rather than checking for the existence of a character.

Overall, a lot of the work just needs some cleanup and re-evaluation. The work on kodi-plugin-routing and the Kodi bugs don't help, but we don't want to make too much more work for ourselves in the future.

bigretromike commented 5 years ago

I dont have time because I have more important stuff right now but, ( and in the end you wont understand what I will write ):

da3dsoul commented 5 years ago

Yeah, I plan to put some work in now that I'm bedridden. Like I said, I'm not faulting you. It's a learning experience. We just need to communicate so that we don't just get into stupid commit fights trying to figure out what things are trying to do and why they are written a certain way. I'll try to make it work with Kore. The way that I plan to do it will look stupid. I'll tell you that ahead of time, but for now, there's not a good way to do it.

da3dsoul commented 5 years ago

Get ready for some narcotic fueled code haha

bigretromike commented 5 years ago

kore/webui when you browse content and click ".." delete last path from url: /menu/group/2/filter/1 when clicked on .. change it to /menu/group/2/filter which is invalid - that was main issue for webui/kore, it was not to play content but browse. ( I tried supporting more paths but that failed for some insance - like when you got use group, so you see series, go back, see error on tv, still in series, go back, see series, go back see error on tv, go back, you end up in filter)

Other issue where those with cached kodi folder structure, that would end up in some strange times when you had few cached episodes, I also workaround it with proper refreshing listing etc - that was super hard to debug, because it was always random thing.

Do as you pleased, just don't break stuffs that I already fixed - and I'm talking about every setting, not the one you used - I put a lot of work to make it as much fixed as I could. Also try to not change to much of player/eigakan code, because that one you can't test as its not a public beta.

I hope I see Nirvana thru your code and hope you get well soon.

Do as you please until I return, but keep in in master branch - until I push it to stable. It would be super cool to use official routing plugin, if that's even possible, or just fork-out the one we use with different name to it wont get conflicts (netflix/plex does that - they use their own lib)

bigretromike commented 5 years ago

I released last update before I'm going radio-silent (it will autobuild in few hours - once per day). If there anything really big that you need to push to stable you know how to do that, no need to keep it in dev only. Again, get well soon.

da3dsoul commented 5 years ago

Interesting. Good to know

bigretromike commented 4 years ago

Ok, I would like to get back on track. Were you able to readd my work already ? Or can I readd it in near future ?