audio_addict 0.1.3 → 0.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
 - data/README.md +1 -0
 - data/lib/audio_addict/cli.rb +1 -0
 - data/lib/audio_addict/commands/history.rb +29 -0
 - data/lib/audio_addict/commands/vote.rb +1 -1
 - data/lib/audio_addict/version.rb +1 -1
 - metadata +3 -2
 
    
        checksums.yaml
    CHANGED
    
    | 
         @@ -1,7 +1,7 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            ---
         
     | 
| 
       2 
2 
     | 
    
         
             
            SHA256:
         
     | 
| 
       3 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       4 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 3 
     | 
    
         
            +
              metadata.gz: b1a2413418f94134ab1e8ad4bc556c9e31e4bc25f93821d7464761f226d33c51
         
     | 
| 
      
 4 
     | 
    
         
            +
              data.tar.gz: 71e19ca4ff20d6b903687361239b119041eb142420b305edcaf0d6b23e261a07
         
     | 
| 
       5 
5 
     | 
    
         
             
            SHA512:
         
     | 
| 
       6 
     | 
    
         
            -
              metadata.gz:  
     | 
| 
       7 
     | 
    
         
            -
              data.tar.gz:  
     | 
| 
      
 6 
     | 
    
         
            +
              metadata.gz: 738afe0afba2a9ee10b62b1f1a9748f88d5a0d81b57bfae2f417ced6b47926fc932423b8cc03e9a72190dd44fd01decefd4de757f4282e05edd973db139f4b98
         
     | 
| 
      
 7 
     | 
    
         
            +
              data.tar.gz: 402a9e2f05661831b0a5f7943bed9abf8cb9771c1c23e1d3942deaac54bfb65b71b0cc04d73961bc6a456adbc6d0b7ae250204b67e9321c9cde3303ce6f928e2
         
     | 
    
        data/README.md
    CHANGED
    
    | 
         @@ -64,6 +64,7 @@ Commands: 
     | 
|
| 
       64 
64 
     | 
    
         
             
              set       Set the radio network and channel
         
     | 
| 
       65 
65 
     | 
    
         
             
              channels  Show list of channels
         
     | 
| 
       66 
66 
     | 
    
         
             
              now       Show network, channel and playing track
         
     | 
| 
      
 67 
     | 
    
         
            +
              history   Show track history for the current channel
         
     | 
| 
       67 
68 
     | 
    
         
             
              vote      Vote on the currently playing track
         
     | 
| 
       68 
69 
     | 
    
         
             
              playlist  Generate playlists
         
     | 
| 
       69 
70 
     | 
    
         
             
              config    Manage local configuration
         
     | 
    
        data/lib/audio_addict/cli.rb
    CHANGED
    
    | 
         @@ -9,6 +9,7 @@ module AudioAddict 
     | 
|
| 
       9 
9 
     | 
    
         
             
                  router.route 'set',      to: Commands::SetCmd
         
     | 
| 
       10 
10 
     | 
    
         
             
                  router.route 'channels', to: Commands::ChannelsCmd
         
     | 
| 
       11 
11 
     | 
    
         
             
                  router.route 'now',      to: Commands::NowCmd
         
     | 
| 
      
 12 
     | 
    
         
            +
                  router.route 'history',  to: Commands::HistoryCmd
         
     | 
| 
       12 
13 
     | 
    
         
             
                  router.route 'vote',     to: Commands::VoteCmd
         
     | 
| 
       13 
14 
     | 
    
         
             
                  router.route 'playlist', to: Commands::PlaylistCmd
         
     | 
| 
       14 
15 
     | 
    
         
             
                  router.route 'config',   to: Commands::ConfigCmd
         
     | 
| 
         @@ -0,0 +1,29 @@ 
     | 
|
| 
      
 1 
     | 
    
         
            +
            module AudioAddict
         
     | 
| 
      
 2 
     | 
    
         
            +
              module Commands
         
     | 
| 
      
 3 
     | 
    
         
            +
                class HistoryCmd < Base
         
     | 
| 
      
 4 
     | 
    
         
            +
                  summary "Show track history for the current channel" 
         
     | 
| 
      
 5 
     | 
    
         
            +
             
     | 
| 
      
 6 
     | 
    
         
            +
                  usage "radio history"
         
     | 
| 
      
 7 
     | 
    
         
            +
                  usage "radio history --help"
         
     | 
| 
      
 8 
     | 
    
         
            +
             
     | 
| 
      
 9 
     | 
    
         
            +
                  def run(args)
         
     | 
| 
      
 10 
     | 
    
         
            +
                    needs :network, :channel
         
     | 
| 
      
 11 
     | 
    
         
            +
                    say "!undgrn!#{radio.name} > #{current_channel.name}"
         
     | 
| 
      
 12 
     | 
    
         
            +
                    say ''
         
     | 
| 
      
 13 
     | 
    
         
            +
                    tracks.each do |channel|
         
     | 
| 
      
 14 
     | 
    
         
            +
                      say "!txtgrn! #{channel.artist.rjust max_artist_len}!txtrst! : !txtblu!#{channel.title}"
         
     | 
| 
      
 15 
     | 
    
         
            +
                    end
         
     | 
| 
      
 16 
     | 
    
         
            +
                  end
         
     | 
| 
      
 17 
     | 
    
         
            +
             
     | 
| 
      
 18 
     | 
    
         
            +
                private
         
     | 
| 
      
 19 
     | 
    
         
            +
             
     | 
| 
      
 20 
     | 
    
         
            +
                  def tracks
         
     | 
| 
      
 21 
     | 
    
         
            +
                    @tracks ||= current_channel.track_history
         
     | 
| 
      
 22 
     | 
    
         
            +
                  end
         
     | 
| 
      
 23 
     | 
    
         
            +
             
     | 
| 
      
 24 
     | 
    
         
            +
                  def max_artist_len
         
     | 
| 
      
 25 
     | 
    
         
            +
                    tracks.map { |t| t.artist.size }.max
         
     | 
| 
      
 26 
     | 
    
         
            +
                  end
         
     | 
| 
      
 27 
     | 
    
         
            +
                end
         
     | 
| 
      
 28 
     | 
    
         
            +
              end
         
     | 
| 
      
 29 
     | 
    
         
            +
            end
         
     | 
    
        data/lib/audio_addict/version.rb
    CHANGED
    
    
    
        metadata
    CHANGED
    
    | 
         @@ -1,14 +1,14 @@ 
     | 
|
| 
       1 
1 
     | 
    
         
             
            --- !ruby/object:Gem::Specification
         
     | 
| 
       2 
2 
     | 
    
         
             
            name: audio_addict
         
     | 
| 
       3 
3 
     | 
    
         
             
            version: !ruby/object:Gem::Version
         
     | 
| 
       4 
     | 
    
         
            -
              version: 0.1. 
     | 
| 
      
 4 
     | 
    
         
            +
              version: 0.1.4
         
     | 
| 
       5 
5 
     | 
    
         
             
            platform: ruby
         
     | 
| 
       6 
6 
     | 
    
         
             
            authors:
         
     | 
| 
       7 
7 
     | 
    
         
             
            - Danny Ben Shitrit
         
     | 
| 
       8 
8 
     | 
    
         
             
            autorequire: 
         
     | 
| 
       9 
9 
     | 
    
         
             
            bindir: bin
         
     | 
| 
       10 
10 
     | 
    
         
             
            cert_chain: []
         
     | 
| 
       11 
     | 
    
         
            -
            date: 2018-12- 
     | 
| 
      
 11 
     | 
    
         
            +
            date: 2018-12-03 00:00:00.000000000 Z
         
     | 
| 
       12 
12 
     | 
    
         
             
            dependencies:
         
     | 
| 
       13 
13 
     | 
    
         
             
            - !ruby/object:Gem::Dependency
         
     | 
| 
       14 
14 
     | 
    
         
             
              name: colsole
         
     | 
| 
         @@ -113,6 +113,7 @@ files: 
     | 
|
| 
       113 
113 
     | 
    
         
             
            - lib/audio_addict/commands/base.rb
         
     | 
| 
       114 
114 
     | 
    
         
             
            - lib/audio_addict/commands/channels.rb
         
     | 
| 
       115 
115 
     | 
    
         
             
            - lib/audio_addict/commands/config.rb
         
     | 
| 
      
 116 
     | 
    
         
            +
            - lib/audio_addict/commands/history.rb
         
     | 
| 
       116 
117 
     | 
    
         
             
            - lib/audio_addict/commands/log.rb
         
     | 
| 
       117 
118 
     | 
    
         
             
            - lib/audio_addict/commands/login.rb
         
     | 
| 
       118 
119 
     | 
    
         
             
            - lib/audio_addict/commands/now.rb
         
     |