Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move recording variables to Advanced Variables section #213

Merged
merged 5 commits into from
Oct 18, 2023

Conversation

rdswift
Copy link
Collaborator

@rdswift rdswift commented Sep 29, 2023

Summary

This is a…

  • Correction
  • Addition
  • Restructuring
  • Minor / simple change (like a typo)
  • Other

Reason for the Change

The recording variables were shown in the Basic Variables section, when they actually require that the recording level relationships option be enabled.

Description of the Change

Move the recording variables to the Advanced Variables section.

Additional Action Required

Update translation files.

@rdswift rdswift added bug Something isn't working documentation Improvements or additions to documentation labels Sep 29, 2023
@rdswift rdswift requested a review from phw September 29, 2023 16:38
Copy link
Member

@phw phw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to check this in more detail, even for more tags. The work series variables are also depending on track relationships. We might even have other work related variables that are only available with track relationships.

Furthermore there is also the release relationships variable, I think the docs currently don't consider this. I think we should check which variables and tags this setting affect. But for sure the release and release group series variables.

variables/variables_advanced.rst Outdated Show resolved Hide resolved
Copy link
Member

@phw phw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked a bit into it, I think with the comments I added this should work.

I think the work series relationships are also only available when "release relationships" are enabled (this enables both recording-level-rels and work-level-rels in the API requests, see https://github.com/metabrainz/picard/blob/master/picard/album.py#L616-L620).

But then there are also the release series and release group series variables. Those are only available when "release relationships" are enabled. So I assume we need a section in advanced variables which lists only variables available with "release relationships" enabled.

variables/variables_advanced.rst Outdated Show resolved Hide resolved
variables/variables_advanced.rst Outdated Show resolved Hide resolved
@rdswift
Copy link
Collaborator Author

rdswift commented Oct 15, 2023

I've created some subsections of the tags and variables pages, and tried to move each tag and variable into the appropriate section. I've tried to base the catagorization on actual test data (test releases are noted in the "Advanced" pages as a comment), but I wasn't able to confirm all of the items. I also updated some of the item descriptions, and reformatted the files to provide consistent formatting (items on single lines, a single space between sentences, etc.)

I would appreciate it if someone could take a quick look and see if there's anything that is incorrect or could be improved. Thanks.

@rdswift rdswift requested a review from phw October 15, 2023 17:15
Copy link
Member

@phw phw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot for this update. This is a real improvement already.

And it is also pretty interesting to dive into these details. We never really dissected it like this and this all more worked on a "feeling". This is also the reason it took me some days to actually review this.

I have a couple of comments and suggestions. Please double check these, it's really easy to get things wrong here.

variables/tags_advanced.rst Outdated Show resolved Hide resolved
variables/tags_basic.rst Outdated Show resolved Hide resolved
variables/variables_advanced.rst Outdated Show resolved Hide resolved
variables/variables_basic.rst Outdated Show resolved Hide resolved

**_releasegroup_firstreleasedate**

The date of the earliest release in the Release Group in the format YYYY-MM-DD. This is intended to provide, for example, the release date of the vinyl version of what you have on CD. (*Since Picard 2.6*)
The date of the earliest release in the release group in the format YYYY-MM-DD. This is intended to provide, for example, the release date of the vinyl version of what you have on CD. (*Since Picard 2.6*)

.. note::

This is the same information provided by default in the ``originaldate`` tag.

**_releasegroup_series**
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The _releasegroup_series* variables require release relationships enabled. Hence I think they should be in advanced variables in a sections for only available with release relationships.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, they don't require either the "track relationships" or "release relationships" options to be enabled. I just tested using release "59f6dc82-6e05-4d58-8fae-d93c55a250ef" with both options disabled and the _releasegroup_series variables were all populated.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, that's interesting. Didn't expect that. I'll check.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One thing is that enabling track Level rels automatically implies release Level rels also being used, see https://github.com/metabrainz/picard/blob/master/picard/album.py#L607 . That's maybe something we need to indicate in the UI or such, but technically it makes sense.

But disabling both I would have expected nothing to be returned. Maybe that is some MB API specific thing how RG relationships are being handled?

I'm currently not at my laptop and can't properly check API calls. But I think if it currently behaves that way we can leave it in the documentation as you currently have it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I saw that in the Picard code. I never thought to update the UI to clarify but that makes sense. I'll enter a ticket (and PR if I can think of a nice way to show it).

I'll hold off merging this until you have a chance to confirm that it doesn't require either option enabled. I'm so confused by all of this that I'm not trusting my own testing any more. BTW, I actually did my tests in Picard, because I found it easier than trying to sort through the API response and follow how it was processed within Picard. 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you test again with e.g. https://musicbrainz.org/release-group/53ed88d5-9b8b-44c8-9e18-7324284c3ec9 ? As expected I get the releasegroup_series tags only if at least release relationships are enabled.

Okay, this is just weird. Running Picard v2.10 installed on a Linux Mint system with both release and track relationships disabled, when I load the release from the release group you specified, I still get the _releasegroup_series variables.

image

Running Picard v2.10 from the latest source code (master branch) on the same Linux Mint system with both release and track relationships disabled, when I load the release from the release group you specified, I don't get the _releasegroup_series variables.

image

The other thing (totally unrelated) is when I run from source any selected item disappears -- see Track 1 in the listing. I assume the text color is being set to the background color, and I suspect this is a bug with Qt (or Mint) because it does this with other applications running from source.

In any event, to be on the safe side I'll move those variables in the documentation to show that they require the release relationships enabled. If the user gets them without them enabled, that's just a bonus. 😉

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now when I test again running the installed version, when I load the release from the release group you specified, I don't get the _releasegroup_series* variables. I wonder if it was somehow retrieving the values from a cached response to the query. Do you know off hand if Picard retains the metadata from a previous load of an album (in the same session) when the album is refreshed? If so, that's likely what I'm seeing.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just tested again, and it seems that Picard IS retaining metadata from a prior load of an album. To confirm, try the following:

  1. Start Picard.
  2. Open the option settings and disable both release and track relationships.
  3. Load the test album (release:d8dcd3d2-50d0-47df-ab0a-542606ba5912)
  4. Confirm _releasegroup_series* variables are not populated.
  5. Open the option settings and enable both release and track relationships.
  6. Refresh the test album.
  7. Confirm _releasegroup_series* variables are populated.
  8. Open the option settings and disable both release and track relationships.
  9. Refresh the test album.
  10. Confirm _releasegroup_series* variables are populated (even though the relationships are disabled)
  11. Remove the test album from the right-hand pane.
  12. Load the test album again.
  13. Confirm _releasegroup_series* variables are populated (even though the relationships are disabled)

I assume that Picard is caching all of the metadata from the most detailed album retrieval, and that items no longer provided in subsequent retrievals are being filled from the cache. Further, Picard is not clearing this cache when the album is removed. That makes sense to avoid making multiple calls to the API, but it totally screwed up my testing. 😜

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a request cache. But it should be different as the URL changes for the different requests. That's really weird, I also can't reproduce.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that is wierd. It is 100% reproducable here, both using the installed version of Picard and when running from source. Unfortunately, I don't have time right now to try and track down the reason. In any event, with those variables moved to the Advanced section, I think we're covered on the documentation front.

variables/tags_advanced.rst Show resolved Hide resolved
@rdswift rdswift merged commit 7db90c7 into master Oct 18, 2023
2 checks passed
@rdswift rdswift deleted the recording_series_variables branch October 18, 2023 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants