Skip to content

Stripping of trailing slashes breaks stuff #24

@michaelarnauts

Description

@michaelarnauts

Related to #22 and #12

It seems the recent changes in routing regarding the stripping of slashes broke a few things. I also learned that Kodi doesn't like urls without a trailing slash when they point to a directory listing. See xbmc/xbmc#16516 (comment)
Stripping them seems like a bad idea then. They won't work when bookmarked since the last part gets stripped of if it doesn't end with a slash.

IMO, this should be the right behavior then:

  • @plugin.route('/tvshows/category/<category>/'): plugin.url_for() should include the slash
  • @plugin.route('/tvshows/category/<category>'): plugin.url_for() should not include the slash
  • a route to /tvshows/category/ should end up on the function with the @plugin.route('/tvshows/category/<category>/') decorator
  • a route to /tvshows/category should end up on the function with the @plugin.route('/tvshows/category/<category>') decorator

I guess this was the behaviour of 0.2.0.

The one thing that could be added is that:

  • a route to /tvshows/category could also end up on the function with the @plugin.route('/tvshows/category/<category>/') decorator
  • a route to /tvshows/category/ should also end up on the function with the @plugin.route('/tvshows/category/<category>') decorator

@tamland and @dagwieers what do you think?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions