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

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

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Normal
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2019-10-14
    • Component/s: Web service
    • Labels:
      None

      Description

      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. 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

        Attachments

          Activity

            People

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

              Dates

              • Created:
                Updated:
                Resolved:

                Packages

                Version Package
                2019-10-14