Skip to content

Conversation

@gcoppola19
Copy link

Fixes #6092

Add a media field for album, when a user runs beets fields, media will be listed for album. This way, media of album can be kept track of.

  • Documentation. (If you've added a new command-line flag, for example, find the appropriate page under docs/ to describe it.)
  • Changelog. (Add an entry to docs/changelog.rst to the bottom of one of the lists near the top of the document.)
  • [x ] Tests.
    test_media_field.py

@gcoppola19 gcoppola19 requested a review from a team as a code owner November 8, 2025 19:18
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey there - I've reviewed your changes and they look great!

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location> `test/test_media_field.py:4-11` </location>
<code_context>
+from beets.library import Item
+from beets import library
+
+def test_album_media_field(tmp_path):
+    lib = library.Library(path=str(tmp_path / "library.db"),
+                          directory=str(tmp_path / "music"))
+
+    item = Item(title="Test Song", album="Test Album", media="Vinyl")
+    album = lib.add_album([item])   
+
+    assert album.media == "Vinyl"
\ No newline at end of file
</code_context>

<issue_to_address>
**suggestion (testing):** Consider adding tests for edge cases and error conditions for the 'media' field.

Additional tests for cases where 'media' is missing, None, an empty string, or a non-string value would improve coverage and help identify potential issues.
</issue_to_address>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@gcoppola19 gcoppola19 closed this Nov 8, 2025
@codecov
Copy link

codecov bot commented Nov 8, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 67.34%. Comparing base (beda6fc) to head (9663371).
⚠️ Report is 18 commits behind head on master.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6151      +/-   ##
==========================================
+ Coverage   67.23%   67.34%   +0.10%     
==========================================
  Files         120      136      +16     
  Lines       18440    18492      +52     
  Branches     3134     3134              
==========================================
+ Hits        12398    12453      +55     
+ Misses       5372     5370       -2     
+ Partials      670      669       -1     
Files with missing lines Coverage Δ
beets/library/models.py 87.17% <ø> (ø)

... and 21 files with indirect coverage changes

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

$media is only available as an item field

1 participant