Uploaded image for project: 'MusicBrainz Server'
  1. MusicBrainz Server
  2. MBS-10370

Add `direction: forward` to all forward relationships in WS

XMLWordPrintable

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Normal Normal
    • 2019-10-14
    • None
    • Web service
    • None

      Currently the webservice will return <direction>backward</direction> if the relationship between the requested item and the item in the relation list is backwards. However, there's no equivalent attribute returned for forward relationships. This means that checking for a relationship requires you to first check if the key exists (if so, it's forwards), otherwise if it exists and says backward, then it's backwards. This is especially problematic in python, where we try and do rel["direction"], which will raise a KeyError if the attribute doesn't exist. mr_monkey mentioned a similar situation in the BB API with javascript.

      We proposed adding this attribute always, and having it show forward for forwards relationships. This should be a backwards compatible change, however there may be people who only check for the presence of the <direction> tag to determine if it's a backwards relationship and don't actually check the value.

      Discussion: https://chatlogs.metabrainz.org/brainzbot/metabrainz/2019-09-16/?msg=4456957&page=2

            reosarevok Nicolás Tamargo
            alastairp Alastair Porter
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved:

                Version Package
                2019-10-14