add movies and update the script

Signed-off-by: Bogomil Vasilev <smirky@smirky.net>
This commit is contained in:
2026-02-13 14:00:30 +02:00
parent b2b8089320
commit 6da4cb891b
4 changed files with 17 additions and 66 deletions

View File

@@ -28,7 +28,7 @@ class MovieList:
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>My Movie List</title> <title>My Movie List</title>
<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css"> <link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.10.24/css/jquery.dataTables.min.css">
<script src="../jquery-3.1.0.min.js"></script> <script src="../jquery-3.7.1.min.js"></script>
<script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script> <script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
<style> <style>
* { * {
@@ -144,7 +144,7 @@ class MovieList:
border-radius: 3px; border-radius: 3px;
} }
table.dataTable.stripe tbody tr.odd, table.dataTable.stripe tbody tr.odd,
table.dataTable.display tbody tr.odd, table.dataTable.display tbody tr.odd,
table.dataTable tbody tr { table.dataTable tbody tr {
background: transparent !important; background: transparent !important;
@@ -375,7 +375,7 @@ class MovieList:
html_title_td = movie['title'] if 'dummy' in movie.keys() else \ html_title_td = movie['title'] if 'dummy' in movie.keys() else \
f'<a href="https://www.imdb.com/title/tt{movie.movieID}" target="_blank">{movie["title"]}</a>' f'<a href="https://www.imdb.com/title/tt{movie.movieID}" target="_blank">{movie["title"]}</a>'
self.html_table[index] = ( self.html_table[index] = (
f'\n <tr>' f'\n <tr>'
f'<td data-label="#">{index + 1}</td>' f'<td data-label="#">{index + 1}</td>'
@@ -419,8 +419,8 @@ class MovieList:
pbar = progressbar.ProgressBar(max_value=len(self.movie_list)) pbar = progressbar.ProgressBar(max_value=len(self.movie_list))
for idx, movie in self.movie_list.items(): for idx, movie in self.movie_list.items():
# More precise matching - look for the hidden <p> tag with exact title # More precise matching - look for the hidden <p> tag with exact title
match = [html_row for html_row in self.prev_html match = [html_row for html_row in self.prev_html
if f'<p hidden>{movie["title"]}</p>' in html_row if f'<p hidden>{movie["title"]}</p>' in html_row
and 'N/A' not in html_row] and 'N/A' not in html_row]
if match: if match:
# Update the index and status from the cached row # Update the index and status from the cached row
@@ -451,14 +451,14 @@ class MovieList:
self.delete_finished_threads() self.delete_finished_threads()
self.html += ''.join(self.html_table) self.html += ''.join(self.html_table)
# Deduplicate entries before writing # Deduplicate entries before writing
num_entries = self.deduplicate_html() num_entries = self.deduplicate_html()
print(f"\nDeduplicated to {num_entries} unique entries") print(f"\nDeduplicated to {num_entries} unique entries")
self.html = self.html.split('</tbody>')[0] # Remove everything after tbody if it exists self.html = self.html.split('</tbody>')[0] # Remove everything after tbody if it exists
self.html += ''.join(self.html_table) self.html += ''.join(self.html_table)
return True return True
def delete_finished_threads(self): def delete_finished_threads(self):
@@ -494,22 +494,22 @@ class MovieList:
if self.dst.exists(): if self.dst.exists():
with open(self.dst, 'rb') as fp_handle: with open(self.dst, 'rb') as fp_handle:
self.prev_html = fp_handle.read().decode('utf8').split('\n') self.prev_html = fp_handle.read().decode('utf8').split('\n')
def deduplicate_html(self): def deduplicate_html(self):
""" Remove duplicate entries from html_table based on movie titles """ """ Remove duplicate entries from html_table based on movie titles """
seen_titles = set() seen_titles = set()
deduplicated = [] deduplicated = []
for idx, row in enumerate(self.html_table): for idx, row in enumerate(self.html_table):
if row is None: if row is None:
continue continue
# Extract the hidden title from the row # Extract the hidden title from the row
if '<p hidden>' in row and '</p>' in row: if '<p hidden>' in row and '</p>' in row:
start = row.find('<p hidden>') + 10 start = row.find('<p hidden>') + 10
end = row.find('</p>', start) end = row.find('</p>', start)
title = row[start:end] title = row[start:end]
if title not in seen_titles: if title not in seen_titles:
seen_titles.add(title) seen_titles.add(title)
deduplicated.append(row) deduplicated.append(row)
@@ -519,7 +519,7 @@ class MovieList:
else: else:
# If we can't find the hidden title, keep the row anyway # If we can't find the hidden title, keep the row anyway
deduplicated.append(row) deduplicated.append(row)
# Update html_table with deduplicated content # Update html_table with deduplicated content
self.html_table = deduplicated self.html_table = deduplicated
return len(self.html_table) return len(self.html_table)

View File

@@ -460,6 +460,9 @@ Woman at War (2018) [DONE]
Good Fortune (2025) [DONE] Good Fortune (2025) [DONE]
The Age of Disclosure (2025) [*] The Age of Disclosure (2025) [*]
Evil Does Not Exist (2023) [DONE] Evil Does Not Exist (2023) [DONE]
I.S.S. (2023) [*]
Black Cat, White Cat (1998) [DONE] Black Cat, White Cat (1998) [DONE]
Nuremberg (2025) [DONE] Nuremberg (2025) [DONE]
Poor Things (2023) [*]
The French Dispatch (2021) [DONE]
Sentimental Value (2025) [DONE]
28 Years Later: The Bone Temple (2026) [*]

View File

@@ -1,11 +0,0 @@
(function() {
var si = document.querySelector(".scroll-indicator");
var onscroll = function() {
var max = document.body.scrollHeight - window.innerHeight;
si.style.display = "block";
si.style.width = (window.pageYOffset / max * 100) + "%";
};
window.onscroll = onscroll;
onscroll();
})();

View File

@@ -1,41 +0,0 @@
.scroll-indicator {
display: none;
position: fixed;
top: 0;
left: 0;
width: 50%;
height: 10px;
background: #C33;
}
th {
background-color: #4CAF50;
cursor:pointer;
text-align: center;
}
th, td {
padding: 1px;
border-bottom: 1px solid #ddd;
font-family: arial, sans-serif;
font-size: 12px;
}
body {
background-color: #3D3635;
font-family: arial, sans-serif;
color: white;
font-size: 12px;
}
td {
color: #ffffff;
background-color: #3D3635;
}
a:link, a:visited {
background-color: #3D3635;
color: white;
text-decoration: none;
display: inline-block;
}