Module: Id3Taginator::Frames::UfidFrames
Instance Method Summary collapse
-
#remove_unique_file_identifier(owner_id) ⇒ Object
removes a unique file identifier for the specific owner_id.
-
#unique_file_identifiers ⇒ Array<Frames::Ufid::Entities::UfidInfo>
extracts the unique file identifier (UFID/UFI).
-
#unique_file_identifiers=(identifier) ⇒ Object
(also: #add_unique_file_identifier)
adds a comment (UFID/UFI) Multiple ones can be added, as long as they have different owner_id.
Methods included from Frameable
#find_frame, #find_frames, #set_frame_fields, #set_frame_fields_by_selector, #unsupported_frame
Instance Method Details
#remove_unique_file_identifier(owner_id) ⇒ Object
removes a unique file identifier for the specific owner_id
33 34 35 36 37 |
# File 'lib/id3taginator/frames/ufid_frames.rb', line 33 def remove_unique_file_identifier(owner_id) @frames.delete_if do |f| f.frame_id == Ufid::UniqueFileIdentifierFrame.frame_id(@major_version, ) && f.owner_id == owner_id end end |
#unique_file_identifiers ⇒ Array<Frames::Ufid::Entities::UfidInfo>
extracts the unique file identifier (UFID/UFI)
11 12 13 14 15 16 |
# File 'lib/id3taginator/frames/ufid_frames.rb', line 11 def unique_file_identifiers frame = find_frames(Ufid::UniqueFileIdentifierFrame.frame_id(@major_version, )) return [] if frame.nil? || frame.empty? frame.map { |f| Ufid::Entities::UfidInfo.new(f.owner_id, f.identifier) } end |
#unique_file_identifiers=(identifier) ⇒ Object Also known as: add_unique_file_identifier
adds a comment (UFID/UFI) Multiple ones can be added, as long as they have different owner_id
22 23 24 25 26 |
# File 'lib/id3taginator/frames/ufid_frames.rb', line 22 def unique_file_identifiers=(identifier) set_frame_fields_by_selector(Ufid::UniqueFileIdentifierFrame, i[@owner_id @identifier], ->(f) { f.owner_id == identifier.owner_id }, identifier.owner_id, identifier.identifier) end |