Module: Id3Taginator::Frames::CountFrames
Instance Method Summary collapse
-
#play_counter ⇒ Integer?
extracts the play count (PCNT/CNT).
-
#play_counter=(counter) ⇒ Object
sets a counter (PCNT/CNT).
-
#popularity ⇒ Frames::Count::Entities::Popularimeter?
extracts the popularity (POPM/POP).
-
#popularity=(popularity) ⇒ Object
sets a counter (POPM/POP).
-
#remove_play_counter ⇒ Object
removes the play counter frame.
-
#remove_popularity ⇒ Object
removes the popularity frame.
Methods included from Frameable
#find_frame, #find_frames, #set_frame_fields, #set_frame_fields_by_selector, #unsupported_frame
Instance Method Details
#play_counter ⇒ Integer?
extracts the play count (PCNT/CNT)
11 12 13 |
# File 'lib/id3taginator/frames/count_frames.rb', line 11 def play_counter find_frame(Count::PlayCounterFrame.frame_id(@major_version, @options))&.counter end |
#play_counter=(counter) ⇒ Object
sets a counter (PCNT/CNT)
18 19 20 |
# File 'lib/id3taginator/frames/count_frames.rb', line 18 def play_counter=(counter) set_frame_fields(Count::PlayCounterFrame, [:@counter], counter) end |
#popularity ⇒ Frames::Count::Entities::Popularimeter?
extracts the popularity (POPM/POP)
30 31 32 33 34 35 |
# File 'lib/id3taginator/frames/count_frames.rb', line 30 def popularity frame = find_frame(Count::PopularityFrame.frame_id(@major_version, @options)) return nil if frame.nil? Count::Entities::Popularimeter.new(frame.email, frame., frame.counter) end |
#popularity=(popularity) ⇒ Object
sets a counter (POPM/POP)
40 41 42 43 |
# File 'lib/id3taginator/frames/count_frames.rb', line 40 def popularity=(popularity) set_frame_fields(Count::PopularityFrame, %i[@email @rating @counter], popularity.email, popularity., popularity.counter) end |
#remove_play_counter ⇒ Object
removes the play counter frame
23 24 25 |
# File 'lib/id3taginator/frames/count_frames.rb', line 23 def remove_play_counter @frames.delete_if { |f| f.frame_id == Count::PlayCounterFrame.frame_id(@major_version, @options) } end |
#remove_popularity ⇒ Object
removes the popularity frame
46 47 48 |
# File 'lib/id3taginator/frames/count_frames.rb', line 46 def remove_popularity @frames.delete_if { |f| f.frame_id == Count::PopularityFrame.frame_id(@major_version, @options) } end |