ektoplayer 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +4 -3
- data/lib/ektoplayer/application.rb +2 -2
- data/lib/ektoplayer/bindings.rb +8 -8
- data/lib/ektoplayer/browsepage.rb +2 -1
- data/lib/ektoplayer/config.rb +9 -9
- data/lib/ektoplayer/controllers/browser.rb +8 -6
- data/lib/ektoplayer/controllers/playlist.rb +8 -6
- data/lib/ektoplayer/database.rb +4 -0
- data/lib/ektoplayer/models/browser.rb +7 -4
- data/lib/ektoplayer/ui/widgets/listwidget.rb +2 -2
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f582176b442c800e228430df528410b4da17417
|
4
|
+
data.tar.gz: 79c3b9f12acb319956f5d47aa98ca00795ed73ca
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1772fa75068b45cb11c0ae4dad2e060459eab414f05a93adf774ccb2451b1918c11a915c0d367369006dd66d9a2cf054ff9ac5e83463994ab7c0c9675e3816dd
|
7
|
+
data.tar.gz: 06e9ac4671e584d4a647e3b88939c4154fa90719e05a6e0535728c535e760430430c44463aa0c4c93ffe2d778b2834ac3b455a388a2c03ee6af9b202282c4448
|
data/README.md
CHANGED
@@ -18,9 +18,10 @@ It allows you to
|
|
18
18
|
|
19
19
|
## Screenshots
|
20
20
|
|
21
|
-
![Screenshot 2017-03-
|
22
|
-
![Screenshot 2017-03-
|
23
|
-
![Screenshot 2017-03-
|
21
|
+
![Screenshot 2017-03-20](http://pixelbanane.de/yafu/454463454/ekto1.gif)
|
22
|
+
![Screenshot 2017-03-20](http://pixelbanane.de/yafu/1213960318/ekto2.gif)
|
23
|
+
![Screenshot 2017-03-20](http://pixelbanane.de/yafu/1573688123/ekto3.gif)
|
24
|
+
![Screenshot 2017-03-20](http://pixelbanane.de/yafu/3388136564/ekto4.gif)
|
24
25
|
|
25
26
|
## Requirements
|
26
27
|
|
@@ -10,7 +10,7 @@ require 'date'
|
|
10
10
|
|
11
11
|
module Ektoplayer
|
12
12
|
class Application
|
13
|
-
VERSION = '0.1.
|
13
|
+
VERSION = '0.1.6'.freeze
|
14
14
|
GITHUB_URL = 'https://github.com/braph/ektoplayer'.freeze
|
15
15
|
EKTOPLAZM_URL = 'http://www.ektoplazm.com'.freeze
|
16
16
|
|
@@ -153,7 +153,7 @@ module Ektoplayer
|
|
153
153
|
end
|
154
154
|
|
155
155
|
if (n = Config[:playlist_load_newest]) > 0
|
156
|
-
r = client.database.select(order_by: 'date', limit: n)
|
156
|
+
r = client.database.select(order_by: 'date desc,album,number', limit: n)
|
157
157
|
playlist.add(*r)
|
158
158
|
end
|
159
159
|
|
data/lib/ektoplayer/bindings.rb
CHANGED
@@ -75,12 +75,12 @@ module Ektoplayer
|
|
75
75
|
:'playlist.show' => [?1 ],
|
76
76
|
:'browser.show' => [?2 ],
|
77
77
|
:'info.show' => [?3 ],
|
78
|
-
:'help.show' => [?4
|
78
|
+
:'help.show' => [?4, Curses::KEY_F1 ],
|
79
79
|
|
80
|
-
:'playinginfo.toggle' => [
|
81
|
-
:'progressbar.toggle' => [
|
82
|
-
:'tabbar.toggle' => [
|
83
|
-
:'volumemeter.toggle' => [
|
80
|
+
:'playinginfo.toggle' => [?!, Curses::KEY_F2 ],
|
81
|
+
:'progressbar.toggle' => [?%, Curses::KEY_F3 ],
|
82
|
+
:'tabbar.toggle' => [?=, Curses::KEY_F4 ],
|
83
|
+
:'volumemeter.toggle' => [?~, Curses::KEY_F5 ],
|
84
84
|
|
85
85
|
:'player.forward' => [?f, Curses::KEY_RIGHT ],
|
86
86
|
:'player.backward' => [?b, Curses::KEY_LEFT ],
|
@@ -90,8 +90,8 @@ module Ektoplayer
|
|
90
90
|
:'playlist.play_next' => [?> ],
|
91
91
|
:'playlist.play_prev' => [?< ],
|
92
92
|
|
93
|
-
:'tabs.next' => [?l
|
94
|
-
:'tabs.prev' => [?h
|
93
|
+
:'tabs.next' => [?l, ?}, 9 ],
|
94
|
+
:'tabs.prev' => [?h, ?{, 353 ],
|
95
95
|
|
96
96
|
:quit => [?q ],
|
97
97
|
:refresh => ['^l' ],
|
@@ -134,7 +134,7 @@ module Ektoplayer
|
|
134
134
|
:'browser.search_down' => [?/ ],
|
135
135
|
# browser
|
136
136
|
:'browser.add_to_playlist' => [' ', ?a ],
|
137
|
-
:'browser.enter' => [
|
137
|
+
:'browser.enter' => [ Curses::KEY_ENTER ],
|
138
138
|
:'browser.back' => [?B, Curses::KEY_BACKSPACE ]},
|
139
139
|
help: {
|
140
140
|
:'help.top' => [?g, Curses::KEY_HOME ],
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#!/bin/ruby
|
2
2
|
|
3
3
|
require 'nokogiri'
|
4
|
+
require 'date'
|
4
5
|
require 'base64'
|
5
6
|
require 'scanf'
|
6
7
|
require 'open-uri'
|
@@ -50,7 +51,7 @@ module Ektoplayer
|
|
50
51
|
|
51
52
|
doc.xpath('//div[starts-with(@id, "post-")]').each do |post|
|
52
53
|
album = { tracks: [] }
|
53
|
-
album[:date] = post.at_css('.d').text
|
54
|
+
album[:date] = Date.parse(post.at_css('.d').text).iso8601 rescue nil
|
54
55
|
album[:category] = post.at_css('.c a').text rescue nil
|
55
56
|
|
56
57
|
album[:styles] = []
|
data/lib/ektoplayer/config.rb
CHANGED
@@ -50,19 +50,19 @@ module Ektoplayer
|
|
50
50
|
CONFIG_DIR = File.join(Dir.home, '.config', 'ektoplayer').freeze
|
51
51
|
CONFIG_FILE = File.join(CONFIG_DIR, 'ektoplayer.rc').freeze
|
52
52
|
|
53
|
-
DEFAULT_PLAYLIST_FORMAT =
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
53
|
+
DEFAULT_PLAYLIST_FORMAT = %{
|
54
|
+
<number size="3" fg="magenta" />
|
55
|
+
<artist rel="25" fg="blue" />
|
56
|
+
<album rel="30" fg="red" />
|
57
|
+
<title rel="33" fg="yellow" />
|
58
|
+
<styles rel="20" fg="cyan" />
|
59
|
+
<bpm size="4" fg="green" justify="right" />}.squeeze(' ').freeze
|
60
60
|
|
61
61
|
DEFAULT_PLAYINGINFO_FORMAT1 =
|
62
62
|
'<text fg="black"><< </text><title bold="on" fg="yellow" /><text fg="black"> >></text>'.freeze
|
63
63
|
|
64
64
|
DEFAULT_PLAYINGINFO_FORMAT2 =
|
65
|
-
'<artist bold="on" fg="blue" /><text> - </text><album bold="on" fg="red" /><text> (</text><
|
65
|
+
'<artist bold="on" fg="blue" /><text> - </text><album bold="on" fg="red" /><text> (</text><year fg="cyan" /><text>)</text>'.freeze
|
66
66
|
|
67
67
|
def register(key, description, default, method=nil)
|
68
68
|
# parameter `description` is used by tools/mkconfig.rb, but not here
|
@@ -118,7 +118,7 @@ module Ektoplayer
|
|
118
118
|
|
119
119
|
reg :playlist_load_newest,
|
120
120
|
%{How many tracks from database should be added to
|
121
|
-
the playlist on application start.},
|
121
|
+
the playlist on application start.}, 300
|
122
122
|
|
123
123
|
reg :use_cache,
|
124
124
|
%{Enable/disable local mp3 cache.
|
@@ -26,15 +26,17 @@ module Ektoplayer
|
|
26
26
|
end
|
27
27
|
|
28
28
|
# TODO: mouse?
|
29
|
-
view.mouse.on(65536) do view.
|
30
|
-
view.mouse.on(2097152) do view.
|
29
|
+
view.mouse.on(65536) do view.up(5) end
|
30
|
+
view.mouse.on(2097152) do view.down(5) end
|
31
31
|
|
32
|
-
|
33
|
-
view.
|
34
|
-
|
32
|
+
[Curses::BUTTON1_DOUBLE_CLICKED, Curses::BUTTON3_CLICKED].each do |btn|
|
33
|
+
view.mouse.on(btn) do |mevent|
|
34
|
+
view.select_from_cursorpos(mevent.y)
|
35
|
+
view_operations.send(:'browser.enter')
|
36
|
+
end
|
35
37
|
end
|
36
38
|
|
37
|
-
[Curses::BUTTON1_CLICKED, Curses::BUTTON2_CLICKED
|
39
|
+
[Curses::BUTTON1_CLICKED, Curses::BUTTON2_CLICKED].
|
38
40
|
each do |button|
|
39
41
|
view.mouse.on(button) do |mevent|
|
40
42
|
view.select_from_cursorpos(mevent.y)
|
@@ -40,19 +40,21 @@ module Ektoplayer
|
|
40
40
|
end
|
41
41
|
|
42
42
|
# TODO: mouse?
|
43
|
-
view.mouse.on(65536) do view.
|
44
|
-
view.mouse.on(2097152) do view.
|
43
|
+
view.mouse.on(65536) do view.up(5) end
|
44
|
+
view.mouse.on(2097152) do view.down(5) end
|
45
45
|
|
46
|
-
[Curses::BUTTON1_CLICKED, Curses::BUTTON2_CLICKED
|
46
|
+
[Curses::BUTTON1_CLICKED, Curses::BUTTON2_CLICKED].
|
47
47
|
each do |button|
|
48
48
|
view.mouse.on(button) do |mevent|
|
49
49
|
view.select_from_cursorpos(mevent.y)
|
50
50
|
end
|
51
51
|
end
|
52
52
|
|
53
|
-
|
54
|
-
view.
|
55
|
-
|
53
|
+
[Curses::BUTTON1_DOUBLE_CLICKED, Curses::BUTTON3_CLICKED].each do |btn|
|
54
|
+
view.mouse.on(btn) do |mevent|
|
55
|
+
view.select_from_cursorpos(mevent.y)
|
56
|
+
view_operations.send('playlist.play')
|
57
|
+
end
|
56
58
|
end
|
57
59
|
end
|
58
60
|
end
|
data/lib/ektoplayer/database.rb
CHANGED
@@ -6,12 +6,13 @@ module Ektoplayer
|
|
6
6
|
PARENT_DIRECTORY = '..'.freeze
|
7
7
|
|
8
8
|
PATHS = {
|
9
|
-
style: [:style ].freeze,
|
10
9
|
artist: [:artist ].freeze,
|
11
10
|
album: [:album ].freeze,
|
11
|
+
style: [:style ].freeze,
|
12
|
+
year: [:year ].freeze,
|
13
|
+
title: [].freeze,
|
12
14
|
released_by: [:released_by].freeze,
|
13
|
-
posted_by: [:posted_by ].freeze
|
14
|
-
tracks: [].freeze
|
15
|
+
posted_by: [:posted_by ].freeze
|
15
16
|
}.freeze
|
16
17
|
|
17
18
|
def initialize(client)
|
@@ -119,7 +120,9 @@ module Ektoplayer
|
|
119
120
|
end
|
120
121
|
|
121
122
|
def tracks(index)
|
122
|
-
@database.select(
|
123
|
+
@database.select(
|
124
|
+
order_by: CONTENTS[index].to_s + ",album,year,number".sub(",#{CONTENTS[index]}", '')
|
125
|
+
)
|
123
126
|
end
|
124
127
|
end
|
125
128
|
end
|
@@ -104,8 +104,8 @@ module UI
|
|
104
104
|
def bottom; self.selected=(index_last) end
|
105
105
|
def page_up; self.scroll_up(size.height) end
|
106
106
|
def page_down; self.scroll_down(size.height) end
|
107
|
-
def up
|
108
|
-
def down
|
107
|
+
def up(n=1) self.selected=(selected - n) end
|
108
|
+
def down(n=1) self.selected=(selected + n) end
|
109
109
|
def center; self.force_cursorpos(@size.height / 2) end
|
110
110
|
|
111
111
|
def list=(list)
|