aniview 5.2.0 → 5.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e5133f4271bdb6e94799eb492eb7b0b4b6e979bf
4
- data.tar.gz: bb5a1a3ecc62de7ec23cb107b4754d7d5772a60b
3
+ metadata.gz: 5a1bad844f503c4a144cfee3edfbaf0298accf39
4
+ data.tar.gz: 229fb0fc773870c98b4ba70cfcb967bd50f2c990
5
5
  SHA512:
6
- metadata.gz: ff10e4467ecc4fb3c641053910a6d302fdd5073a8a641b03a71837b8d8ad7a0d8342f10abe8636429c75affe998d230fac39d6f6eda2b3b19a9de12c52f185d0
7
- data.tar.gz: 0eed2442834d09f373e2fe0cec793eaa242759457856f3995e89440eea4419e9fc40d25730fdb1b7ac4671d85d4f48531cbb0fc7556c9db49c71f4335de5016f
6
+ metadata.gz: 6e62de1566a48fda77f5b315d3db4b7997f8f54cf7366ed610e9c39e30e1f2ba9164d872ca6491f408aee2b1b2ab48c49976e115f94dcd4c4129be30bbecbd74
7
+ data.tar.gz: cb54c2628f3cf600f827d899b3ea4609496bb82a54cb2a4ff99889b52c44cdd05598b9845080c7f246f845f82baeda88db98fa3e99b7996cf87cb049d2ed22c0
@@ -1,22 +1,7 @@
1
1
  #!/usr/bin/env ruby
2
2
  # frozen_string_literal: true
3
3
 
4
- module Zashoku
5
- AppConf = {
6
- app: {
7
- root: File.expand_path('../', __dir__),
8
- name: 'aniview',
9
- modules: {
10
- viewer: %w[AnimeIO Mpv MPVCSide],
11
- daemon: %w[AnimeIO Mpv MPVCSide]
12
- },
13
- save_config: true,
14
- save_history: true,
15
- persistent_daemon: true
16
- }
17
- }
18
- end
19
-
4
+ require_relative '../lib/aniview'
20
5
  require 'zashoku'
21
6
 
22
7
  Zashoku.main(ARGV)
@@ -1,3 +1,21 @@
1
+ # frozen_string_literal: true
2
+
1
3
  module Aniview
2
- Version = [5, 2, 0].freeze
4
+ Version = [5, 3, 0].freeze
5
+ end
6
+
7
+ module Zashoku
8
+ AppConf = {
9
+ app: {
10
+ root: File.expand_path('../', __dir__),
11
+ name: 'aniview',
12
+ modules: {
13
+ viewer: %w[AnimeIO Mpv MPVCSide],
14
+ daemon: %w[AnimeIO Mpv MPVCSide]
15
+ },
16
+ save_config: true,
17
+ save_history: true,
18
+ persistent_daemon: true
19
+ }
20
+ }
3
21
  end
@@ -8,6 +8,7 @@ module Zashoku
8
8
  end
9
9
 
10
10
  def watch(file)
11
+ Zashoku.logger.info("pulling file #{file} for mpvcside")
11
12
  File.open(file, 'r', &:read)
12
13
  end
13
14
  end
@@ -0,0 +1,56 @@
1
+ # frozen_string_literal: true
2
+ require 'securerandom'
3
+ require 'fileutils'
4
+
5
+ module Zashoku
6
+ module MPVCSide
7
+ class MPVCSideView < Zashoku::View
8
+ TMP_FILE = '/tmp/cside-stream-' + SecureRandom.uuid
9
+
10
+ def initialize
11
+ @tmp_file = TMP_FILE + '-' + SecureRandom.uuid
12
+ super
13
+ end
14
+
15
+ def cleanup
16
+ FileUtils.rm(@tmp_file)
17
+ rescue Errno::ENOENT
18
+ Zashoku.logger.warn("mpvcside: file #{@tmp_file} does not exist")
19
+ end
20
+
21
+ def watch(file)
22
+ Zashoku::Util.alert(TMP_FILE)
23
+ Thread.new do
24
+ Zashoku.command(
25
+ mod: 'remote::mpvcside',
26
+ meth: 'watch',
27
+ args: [file],
28
+ to_file: @tmp_file
29
+ )
30
+ end
31
+ sleep 0.1
32
+ while File.stat(@tmp_file).size < 1
33
+ sleep 0.1
34
+ end
35
+ play_tmp
36
+ end
37
+
38
+ def play_tmp
39
+ connect
40
+ @mpv.client.command('loadfile', @tmp_file)
41
+ end
42
+
43
+ def connect
44
+ return unless @mpv&.client&.get_property('idle-active') == nil
45
+
46
+ @mpv = MPV::Session.new(
47
+ user_args: []
48
+ )
49
+ end
50
+
51
+ def refresh_attributes; end
52
+ def refresh_items; {} end
53
+ def get_format; {'title' => ''} end
54
+ end
55
+ end
56
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: aniview
3
3
  version: !ruby/object:Gem::Version
4
- version: 5.2.0
4
+ version: 5.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - annacrombie
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-05 00:00:00.000000000 Z
11
+ date: 2017-12-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: streamio-ffmpeg
@@ -95,12 +95,12 @@ files:
95
95
  - "./modules/mpv/lib/mpv/filename_widget.rb"
96
96
  - "./modules/mpv/lib/mpv/mpv_controller.rb"
97
97
  - "./modules/mpv/lib/mpv/time_widget.rb"
98
- - "./modules/mpv_cside/README.md"
99
- - "./modules/mpv_cside/config/daemon.yml"
100
- - "./modules/mpv_cside/config/view.yml"
101
- - "./modules/mpv_cside/lib/mpv_cside.rb"
102
- - "./modules/mpv_cside/lib/mpv_cside/mpv_cside_controller.rb"
103
- - "./modules/mpv_cside/lib/mpv_cside/mpv_cside_view.rb"
98
+ - "./modules/mpvcside/README.md"
99
+ - "./modules/mpvcside/config/daemon.yml"
100
+ - "./modules/mpvcside/config/view.yml"
101
+ - "./modules/mpvcside/lib/mpv_cside/mpv_cside_controller.rb"
102
+ - "./modules/mpvcside/lib/mpv_cside/mpv_cside_view.rb"
103
+ - "./modules/mpvcside/lib/mpvcside.rb"
104
104
  - bin/aniview
105
105
  homepage: https://github.com/annacrombie/aniview/
106
106
  licenses:
@@ -1,44 +0,0 @@
1
- # frozen_string_literal: true
2
- module Zashoku
3
- module MPVCSide
4
- class MPVCSideView < Zashoku::View
5
- TMP_FILE = '/tmp/cside_stream'
6
-
7
- def refresh_attributes
8
- @attributes = {
9
- 't' => Zashoku.conf.get(%w[title mpv_cside]),
10
- }
11
- end
12
-
13
- def watch(file)
14
- Thread.new do
15
- Zashoku.command(
16
- mod: 'remote::mpv_cside',
17
- meth: 'watch',
18
- args: [file],
19
- to_file: TMP_FILE
20
- )
21
- end
22
- sleep 1
23
- connect
24
- @mpv.client.command('loadfile', TMP_FILE)
25
- end
26
-
27
- def connect
28
- return unless @mpv&.client&.get_property('idle-active') == nil
29
-
30
- @mpv = MPV::Session.new(
31
- user_args: []
32
- )
33
- end
34
-
35
- def refresh_items
36
- {}
37
- end
38
-
39
- def get_format
40
- {'title' => ''}
41
- end
42
- end
43
- end
44
- end