imdb-terminal 2.0.1 → 2.1.0
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/bin/imdb +37 -43
- metadata +25 -12
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8d7d7e6701b93e4398983becfcd60d12bc964a71d1e5a50c8a28da010b627c2c
|
|
4
|
+
data.tar.gz: ce7d0a3926c832ee4f6880cb9cea077c7cdcb122507c84ca7302618ffcb0884c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 682c7dbf08de4a06677cdd5b04f91b1f4530fee204cba4a6d0505bde4b2025620f5b6a8bcda8d982843df29d25c536ac5d2b075647daebcbf304a928395afdfb
|
|
7
|
+
data.tar.gz: ab2ddcd5496e20fb133427833d2790d4ba492a20140e1cd8bff4848eb9bf607839b74f822ea1d8576136410d6ad2b96e9a78d04f2b9a12431a78fdc63c6799c9
|
data/bin/imdb
CHANGED
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
# for any damages resulting from its use. Further, I am under no
|
|
15
15
|
# obligation to maintain or extend this software. It is provided
|
|
16
16
|
# on an 'as is' basis without any expressed or implied warranty.
|
|
17
|
-
# Version: 2.
|
|
17
|
+
# Version: 2.1.0: Modern poster display using termpix gem
|
|
18
18
|
|
|
19
19
|
# REQUIRES AND CONSTANTS {{{1
|
|
20
20
|
require 'io/console'
|
|
@@ -32,6 +32,7 @@ require 'nokogiri'
|
|
|
32
32
|
require 'fileutils'
|
|
33
33
|
require 'concurrent'
|
|
34
34
|
require 'rcurses'
|
|
35
|
+
require 'termpix'
|
|
35
36
|
|
|
36
37
|
include Rcurses
|
|
37
38
|
include Rcurses::Cursor
|
|
@@ -84,8 +85,9 @@ class IMDBApp
|
|
|
84
85
|
@list.border = true
|
|
85
86
|
@last_poster_id = nil
|
|
86
87
|
@current_image = nil
|
|
88
|
+
@termpix = Termpix::Display.new unless WINDOWS
|
|
87
89
|
@last_active_window = nil
|
|
88
|
-
|
|
90
|
+
|
|
89
91
|
run_loop
|
|
90
92
|
ensure
|
|
91
93
|
save_config
|
|
@@ -1324,7 +1326,7 @@ class IMDBApp
|
|
|
1324
1326
|
help_text << " • Dump list removes items from main view permanently\n".fg(230)
|
|
1325
1327
|
help_text << " • TMDb provides streaming provider information\n".fg(230)
|
|
1326
1328
|
unless WINDOWS
|
|
1327
|
-
help_text << " • Posters are displayed
|
|
1329
|
+
help_text << " • Posters are displayed using termpix (Sixel or w3m protocols)\n".fg(230)
|
|
1328
1330
|
else
|
|
1329
1331
|
help_text << " • Poster display not available on Windows\n".fg(230)
|
|
1330
1332
|
end
|
|
@@ -1811,43 +1813,33 @@ class IMDBApp
|
|
|
1811
1813
|
|
|
1812
1814
|
def show_poster(tconst) #{{{2
|
|
1813
1815
|
return if WINDOWS # Skip image display on Windows for now
|
|
1814
|
-
|
|
1815
|
-
|
|
1816
|
-
return unless File.executable?(w3m)
|
|
1816
|
+
return unless @termpix&.supported?
|
|
1817
|
+
|
|
1817
1818
|
cache = cache_dir
|
|
1818
1819
|
file = File.join(cache, "#{tconst}.jpg")
|
|
1819
1820
|
|
|
1820
1821
|
begin
|
|
1821
1822
|
Timeout.timeout(2) do
|
|
1822
|
-
info = `xwininfo -id $(xdotool getactivewindow) 2>/dev/null`
|
|
1823
|
-
return unless info =~ /Width:\s*(\d+).*Height:\s*(\d+)/m
|
|
1824
|
-
term_w, term_h = $1.to_i, $2.to_i
|
|
1825
1823
|
rows, cols = IO.console.winsize
|
|
1826
|
-
cw = term_w.to_f / cols
|
|
1827
|
-
ch = term_h.to_f / rows
|
|
1828
|
-
px = ((@detail.x - 1) * cw).to_i
|
|
1829
|
-
py = (25 * ch).to_i
|
|
1830
|
-
max_w = (40 * cw).to_i
|
|
1831
|
-
max_h = ((rows - 28) * ch).to_i
|
|
1832
1824
|
|
|
1833
|
-
|
|
1825
|
+
# Always clear previous poster first to prevent overlapping
|
|
1826
|
+
@termpix.clear(
|
|
1827
|
+
x: @detail.x - 1,
|
|
1828
|
+
y: 25,
|
|
1829
|
+
width: 40,
|
|
1830
|
+
height: rows - 27,
|
|
1831
|
+
term_width: cols,
|
|
1832
|
+
term_height: rows)
|
|
1834
1833
|
|
|
1835
1834
|
if File.exist?(file) && File.size?(file) > 0
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
iw = iw * max_h / ih; ih = max_h
|
|
1843
|
-
end
|
|
1844
|
-
|
|
1845
|
-
`echo "0;1;#{px};#{py};#{iw};#{ih};;;;;\"#{file}\"\n4;\n3;" | #{w3m} 2>/dev/null`
|
|
1846
|
-
|
|
1847
|
-
# Track the current image
|
|
1835
|
+
# Display new poster using termpix
|
|
1836
|
+
@termpix.show(file,
|
|
1837
|
+
x: @detail.x - 1,
|
|
1838
|
+
y: 25,
|
|
1839
|
+
max_width: 40,
|
|
1840
|
+
max_height: rows - 28)
|
|
1848
1841
|
@current_image = file
|
|
1849
1842
|
else
|
|
1850
|
-
# Clear current image if no file exists
|
|
1851
1843
|
@current_image = nil
|
|
1852
1844
|
end
|
|
1853
1845
|
end
|
|
@@ -1858,24 +1850,26 @@ class IMDBApp
|
|
|
1858
1850
|
|
|
1859
1851
|
def check_image_redraw #{{{2
|
|
1860
1852
|
return if WINDOWS # Skip image redraw on Windows
|
|
1853
|
+
return unless @termpix&.supported?
|
|
1861
1854
|
# Only check if we have an image currently displayed
|
|
1862
1855
|
return unless @current_image && File.exist?(@current_image)
|
|
1863
|
-
|
|
1856
|
+
|
|
1864
1857
|
begin
|
|
1865
|
-
#
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1858
|
+
# For w3m protocol, check if image overlay was cleared
|
|
1859
|
+
if @termpix.protocol == :w3m
|
|
1860
|
+
active_window = `xdotool getactivewindow 2>/dev/null`.chomp
|
|
1861
|
+
return if active_window.empty?
|
|
1862
|
+
|
|
1863
|
+
current_window = `xdotool getwindowfocus 2>/dev/null`.chomp
|
|
1864
|
+
|
|
1865
|
+
# Only redraw if we detect a focus change
|
|
1866
|
+
if @last_active_window && @last_active_window != active_window && current_window == active_window
|
|
1867
|
+
show_poster(@last_poster_id) if @last_poster_id
|
|
1868
|
+
end
|
|
1869
|
+
|
|
1870
|
+
@last_active_window = active_window
|
|
1876
1871
|
end
|
|
1877
|
-
|
|
1878
|
-
@last_active_window = active_window
|
|
1872
|
+
# Sixel images persist, no redraw needed
|
|
1879
1873
|
rescue
|
|
1880
1874
|
# Silently fail - we don't want focus checking to break anything
|
|
1881
1875
|
end
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: imdb-terminal
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.0
|
|
4
|
+
version: 2.1.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Geir Isene
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: bin
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-10-27 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: rcurses
|
|
@@ -24,6 +24,20 @@ dependencies:
|
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
26
|
version: '6.0'
|
|
27
|
+
- !ruby/object:Gem::Dependency
|
|
28
|
+
name: termpix
|
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - "~>"
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '0.1'
|
|
34
|
+
type: :runtime
|
|
35
|
+
prerelease: false
|
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
37
|
+
requirements:
|
|
38
|
+
- - "~>"
|
|
39
|
+
- !ruby/object:Gem::Version
|
|
40
|
+
version: '0.1'
|
|
27
41
|
- !ruby/object:Gem::Dependency
|
|
28
42
|
name: nokogiri
|
|
29
43
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -66,12 +80,11 @@ dependencies:
|
|
|
66
80
|
- - "~>"
|
|
67
81
|
- !ruby/object:Gem::Version
|
|
68
82
|
version: '13.0'
|
|
69
|
-
description: '
|
|
70
|
-
|
|
83
|
+
description: 'IMDB v2.1.0: Modern poster display using termpix gem with Sixel and
|
|
84
|
+
w3m protocol support. Discover and manage movies and TV series from IMDb''s Top
|
|
85
|
+
250 lists. Features smart search with preview mode, advanced filtering by rating/year/genre,
|
|
71
86
|
streaming information via TMDb, wish lists, and terminal poster display. Enhanced
|
|
72
|
-
with jump-to-existing items, duplicate management, and robust data handling.
|
|
73
|
-
2.0.1: Added Windows support - all core functionality works on Windows with graceful
|
|
74
|
-
handling of platform-specific features.'
|
|
87
|
+
with jump-to-existing items, duplicate management, and robust data handling.'
|
|
75
88
|
email: g@isene.com
|
|
76
89
|
executables:
|
|
77
90
|
- imdb
|
|
@@ -90,11 +103,11 @@ metadata:
|
|
|
90
103
|
post_install_message: "✓ IMDb Terminal Browser installed successfully!\n\nTo get started:\n1.
|
|
91
104
|
Run: imdb\n2. On first run, the app will scrape IMDb Top 250 lists\n3. Optional:
|
|
92
105
|
Get a free TMDb API key for streaming info\n4. Press '?' for help once running\n\nExternal
|
|
93
|
-
dependencies for full functionality (Linux/macOS only):\n-
|
|
94
|
-
sudo apt install
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
works normally.\n\nEnjoy discovering your next favorite movie! :-)\n"
|
|
106
|
+
dependencies for full functionality (Linux/macOS only):\n- imagemagick (for image
|
|
107
|
+
processing): sudo apt install imagemagick\n- For w3m protocol: w3m-img, xdotool
|
|
108
|
+
(sudo apt install w3m-img xdotool)\n- For Sixel protocol (mlterm, xterm): imagemagick
|
|
109
|
+
convert command\n\nNote: Poster display is not available on Windows, but all other
|
|
110
|
+
\nfunctionality works normally.\n\nEnjoy discovering your next favorite movie! :-)\n"
|
|
98
111
|
rdoc_options: []
|
|
99
112
|
require_paths:
|
|
100
113
|
- "."
|