Module: Id3Taginator::Frames::UrlFrames
Instance Method Summary collapse
-
#commercial_information_url ⇒ String?
extracts the commercial information url (WCOM/WCM).
-
#commercial_information_url=(url) ⇒ Object
sets the commercial information url (WCOM/WCM).
-
#copyright_information_url ⇒ String?
extracts the copyright information url (WCOP/WCP).
-
#copyright_information_url=(url) ⇒ Object
sets the copyright information url (WCOP/WCP).
-
#official_artist_url ⇒ String?
extracts the official artist url (WOAR/WAR).
-
#official_artist_url=(url) ⇒ Object
sets the official artist url (WOAR/WAR).
-
#official_audio_file_url ⇒ String?
extracts the official audio file url (WOAF/WAF).
-
#official_audio_file_url=(url) ⇒ Object
sets the official audio file url (WOAF/WAF).
-
#official_publisher_webpage ⇒ String?
extracts the official publisher url (WPUB/WPB).
-
#official_publisher_webpage=(url) ⇒ Object
sets the official publisher url (WPUB/WPB).
-
#official_radio_station_homepage ⇒ String?
extracts the official radio station url (WORS).
-
#official_radio_station_homepage=(url) ⇒ Object
sets the official radio station url (WORS).
-
#official_source_url ⇒ String?
extracts the official source url (WOAS/WAS).
-
#official_source_url=(url) ⇒ Object
sets the official source url (WOAS/WAS).
-
#payment_url ⇒ String?
extracts the official radio station url (WPAY).
-
#payment_url=(url) ⇒ Object
sets the payment url (WPAY).
-
#remove_commercial_information_url ⇒ Object
removes the commercial information url frame.
-
#remove_copyright_information_url ⇒ Object
removes the copyright information url frame.
-
#remove_official_artist_url ⇒ Object
removes the official artist url frame.
-
#remove_official_audio_file_url ⇒ Object
removes the official audio file url frame.
-
#remove_official_publisher_webpage ⇒ Object
removes the official publisher webpage frame.
-
#remove_official_radio_station_homepage ⇒ Object
removes the official radio station homepage frame.
-
#remove_official_source_url ⇒ Object
removes the official source url frame.
-
#remove_payment_url ⇒ Object
removes the payment frame.
-
#remove_user_custom_url_link(description) ⇒ Object
removes a user custom url link for the specific description (WXXX/WXX).
-
#user_custom_url_link=(custom_url) ⇒ Object
(also: #add_user_custom_url_link)
adds a user custom url link (WXXX/WXX) Multiple ones can be added, as long as they have different description.
-
#user_custom_url_links ⇒ Array<Frames::Url::Entities::UserInfo>
extracts the user custom url links (WXXX/WXX).
Methods included from Frameable
#find_frame, #find_frames, #set_frame_fields, #set_frame_fields_by_selector, #unsupported_frame
Instance Method Details
#commercial_information_url ⇒ String?
extracts the commercial information url (WCOM/WCM)
11 12 13 |
# File 'lib/id3taginator/frames/url_frames.rb', line 11 def commercial_information_url find_frame(Url::CommercialUrlFrame.frame_id(@major_version, ))&.url end |
#commercial_information_url=(url) ⇒ Object
sets the commercial information url (WCOM/WCM)
18 19 20 |
# File 'lib/id3taginator/frames/url_frames.rb', line 18 def commercial_information_url=(url) set_frame_fields(Url::CommercialUrlFrame, [:@url], url) end |
#copyright_information_url ⇒ String?
extracts the copyright information url (WCOP/WCP)
30 31 32 |
# File 'lib/id3taginator/frames/url_frames.rb', line 30 def copyright_information_url find_frame(Url::CopyrightUrlFrame.frame_id(@major_version, ))&.url end |
#copyright_information_url=(url) ⇒ Object
sets the copyright information url (WCOP/WCP)
37 38 39 |
# File 'lib/id3taginator/frames/url_frames.rb', line 37 def copyright_information_url=(url) set_frame_fields(Url::CopyrightUrlFrame, [:@url], url) end |
#official_artist_url ⇒ String?
extracts the official artist url (WOAR/WAR)
68 69 70 |
# File 'lib/id3taginator/frames/url_frames.rb', line 68 def official_artist_url find_frame(Url::OfficialArtistWebpageFrame.frame_id(@major_version, ))&.url end |
#official_artist_url=(url) ⇒ Object
sets the official artist url (WOAR/WAR)
75 76 77 |
# File 'lib/id3taginator/frames/url_frames.rb', line 75 def official_artist_url=(url) set_frame_fields(Url::OfficialArtistWebpageFrame, [:@url], url) end |
#official_audio_file_url ⇒ String?
extracts the official audio file url (WOAF/WAF)
49 50 51 |
# File 'lib/id3taginator/frames/url_frames.rb', line 49 def official_audio_file_url find_frame(Url::OfficialFileWebpageFrame.frame_id(@major_version, ))&.url end |
#official_audio_file_url=(url) ⇒ Object
sets the official audio file url (WOAF/WAF)
56 57 58 |
# File 'lib/id3taginator/frames/url_frames.rb', line 56 def official_audio_file_url=(url) set_frame_fields(Url::OfficialFileWebpageFrame, [:@url], url) end |
#official_publisher_webpage ⇒ String?
extracts the official publisher url (WPUB/WPB)
146 147 148 |
# File 'lib/id3taginator/frames/url_frames.rb', line 146 def official_publisher_webpage find_frame(Url::OfficialPublisherWebpageFrame.frame_id(@major_version, ))&.url end |
#official_publisher_webpage=(url) ⇒ Object
sets the official publisher url (WPUB/WPB)
153 154 155 |
# File 'lib/id3taginator/frames/url_frames.rb', line 153 def official_publisher_webpage=(url) set_frame_fields(Url::OfficialPublisherWebpageFrame, [:@url], url) end |
#official_radio_station_homepage ⇒ String?
extracts the official radio station url (WORS)
106 107 108 |
# File 'lib/id3taginator/frames/url_frames.rb', line 106 def official_radio_station_homepage find_frame(Url::OfficialAudioRadioStationHomepageFrame.frame_id(@major_version, ))&.url end |
#official_radio_station_homepage=(url) ⇒ Object
sets the official radio station url (WORS)
113 114 115 |
# File 'lib/id3taginator/frames/url_frames.rb', line 113 def official_radio_station_homepage=(url) set_frame_fields(Url::OfficialAudioRadioStationHomepageFrame, [:@url], url) end |
#official_source_url ⇒ String?
extracts the official source url (WOAS/WAS)
87 88 89 |
# File 'lib/id3taginator/frames/url_frames.rb', line 87 def official_source_url find_frame(Url::OfficialSourceWebpageFrame.frame_id(@major_version, ))&.url end |
#official_source_url=(url) ⇒ Object
sets the official source url (WOAS/WAS)
94 95 96 |
# File 'lib/id3taginator/frames/url_frames.rb', line 94 def official_source_url=(url) set_frame_fields(Url::OfficialSourceWebpageFrame, [:@url], url) end |
#payment_url ⇒ String?
extracts the official radio station url (WPAY)
127 128 129 |
# File 'lib/id3taginator/frames/url_frames.rb', line 127 def payment_url find_frame(Url::PaymentUrlFrame.frame_id(@major_version, ))&.url end |
#payment_url=(url) ⇒ Object
sets the payment url (WPAY)
134 135 136 |
# File 'lib/id3taginator/frames/url_frames.rb', line 134 def payment_url=(url) set_frame_fields(Url::PaymentUrlFrame, [:@url], url) end |
#remove_commercial_information_url ⇒ Object
removes the commercial information url frame
23 24 25 |
# File 'lib/id3taginator/frames/url_frames.rb', line 23 def remove_commercial_information_url @frames.delete_if { |f| f.frame_id == Url::CommercialUrlFrame.frame_id(@major_version, ) } end |
#remove_copyright_information_url ⇒ Object
removes the copyright information url frame
42 43 44 |
# File 'lib/id3taginator/frames/url_frames.rb', line 42 def remove_copyright_information_url @frames.delete_if { |f| f.frame_id == Url::CopyrightUrlFrame.frame_id(@major_version, ) } end |
#remove_official_artist_url ⇒ Object
removes the official artist url frame
80 81 82 |
# File 'lib/id3taginator/frames/url_frames.rb', line 80 def remove_official_artist_url @frames.delete_if { |f| f.frame_id == Url::OfficialArtistWebpageFrame.frame_id(@major_version, ) } end |
#remove_official_audio_file_url ⇒ Object
removes the official audio file url frame
61 62 63 |
# File 'lib/id3taginator/frames/url_frames.rb', line 61 def remove_official_audio_file_url @frames.delete_if { |f| f.frame_id == Url::OfficialFileWebpageFrame.frame_id(@major_version, ) } end |
#remove_official_publisher_webpage ⇒ Object
removes the official publisher webpage frame
158 159 160 |
# File 'lib/id3taginator/frames/url_frames.rb', line 158 def remove_official_publisher_webpage @frames.delete_if { |f| f.frame_id == Url::OfficialPublisherWebpageFrame.frame_id(@major_version, ) } end |
#remove_official_radio_station_homepage ⇒ Object
removes the official radio station homepage frame
118 119 120 121 122 |
# File 'lib/id3taginator/frames/url_frames.rb', line 118 def remove_official_radio_station_homepage @frames.delete_if do |f| f.frame_id == Url::OfficialAudioRadioStationHomepageFrame.frame_id(@major_version, ) end end |
#remove_official_source_url ⇒ Object
removes the official source url frame
99 100 101 |
# File 'lib/id3taginator/frames/url_frames.rb', line 99 def remove_official_source_url @frames.delete_if { |f| f.frame_id == Url::OfficialSourceWebpageFrame.frame_id(@major_version, ) } end |
#remove_payment_url ⇒ Object
removes the payment frame
139 140 141 |
# File 'lib/id3taginator/frames/url_frames.rb', line 139 def remove_payment_url @frames.delete_if { |f| f.frame_id == Url::PaymentUrlFrame.frame_id(@major_version, ) } end |
#remove_user_custom_url_link(description) ⇒ Object
removes a user custom url link for the specific description (WXXX/WXX)
187 188 189 190 191 192 |
# File 'lib/id3taginator/frames/url_frames.rb', line 187 def remove_user_custom_url_link(description) @frames.delete_if do |f| f.frame_id == Url::UserUrlLinkFrame.frame_id(@major_version, ) && f.description == description end end |
#user_custom_url_link=(custom_url) ⇒ Object Also known as: add_user_custom_url_link
adds a user custom url link (WXXX/WXX) Multiple ones can be added, as long as they have different description
176 177 178 179 180 |
# File 'lib/id3taginator/frames/url_frames.rb', line 176 def user_custom_url_link=(custom_url) set_frame_fields_by_selector(Url::UserUrlLinkFrame, i[@description @url], ->(f) { f.description == custom_url.description }, custom_url.description, custom_url.url) end |
#user_custom_url_links ⇒ Array<Frames::Url::Entities::UserInfo>
extracts the user custom url links (WXXX/WXX)
165 166 167 168 169 170 |
# File 'lib/id3taginator/frames/url_frames.rb', line 165 def user_custom_url_links frame = find_frames(Url::UserUrlLinkFrame.frame_id(@major_version, )) return [] if frame.nil? || frame.empty? frame.map { |f| Url::Entities::UserInfo.new(f.description, f.url) } end |