Skip to content

Adding Url property to UrlLinkFrame #365

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

powercode
Copy link

Fixes #333
Adding Url and Description to UserUrlLinkFrame

Fixing serialization format to conform to specification at https://id3lib.sourceforge.net/id3/id3v2.3.0.html#sec4.3

Adding Url and Description to UserUrlLinkFrame

Fixing serialization format to conform to specification at
https://id3lib.sourceforge.net/id3/id3v2.3.0.html#sec4.3
@powercode
Copy link
Author

@dotnet-policy-service agree

@decriptor decriptor requested a review from Copilot March 29, 2025 05:01
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds support for URL link frames, including a new UserUrlLinkFrame with separate URL and description properties, and updates serialization to conform to the ID3v2.3.0 specification.

  • Modified Tag.cs to handle UserUrlLinkFrame differently from standard URL link frames
  • Refactored UrlLinkFrame to replace text-based properties with a dedicated Url property and updated parsing/rendering logic
  • Added new tests for UrlLinkFrame and UserUrlLinkFrame to validate proper behavior

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
src/TaglibSharp/Id3v2/Tag.cs Updates in SetTextFrame to differentiate between standard and user URL frames
src/TaglibSharp/Id3v2/Frames/UrlLinkFrame.cs Refactored URL handling, deprecated Text property, and modified parsing/rendering
src/TaglibSharp.Tests/TaggingFormats/Id3V2Test.cs Added tests for both UrlLinkFrame and UserUrlLinkFrame

if (isUserUrlLink) {
var userUrlLinkFrame = (UserUrlLinkFrame)urlLinkFrame;
userUrlLinkFrame.DescriptionEncoding = DefaultEncoding;
userUrlLinkFrame.Description = text[0];
Copy link
Preview

Copilot AI Mar 29, 2025

Choose a reason for hiding this comment

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

Accessing text[0] and text[1] directly without checking the length of the 'text' array may lead to an index out-of-range exception. Consider validating that the 'text' array has at least two elements before assignment.

Copilot uses AI. Check for mistakes.

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.

ID3v2 WXXX frame is empty
1 participant