gonzopi

git clone https://git.tarina.org/gonzopi
Log | Files | Refs | README | LICENSE

commit 0c7724512e90b67893a7c1b74c767ffc383dfe1b
parent c89f5e398512790c5f4d09d94a6a6c3f6b753544
Author: rob <rob@tarina.org>
Date:   Sun, 24 Mar 2024 22:42:05 +0000

change the filmfolder also on server

Diffstat:
Mgonzopi.py | 10+++++++++-
Msrv/gonzopiserver.py | 6++++--
Msrv/templates/filmpage.html | 12++++++------
3 files changed, 19 insertions(+), 9 deletions(-)

diff --git a/gonzopi.py b/gonzopi.py @@ -839,6 +839,8 @@ def main(): updatethumb = True rendermenu = True #cleanupdisk(filmname,filmfolder) + serverstate = gonzopiserver(False) + serverstate = gonzopiserver(True) #REMOVE DELETE #take elif pressed == 'remove' and menu[selected] == 'TAKE:': @@ -1556,7 +1558,10 @@ def main(): try: filmname_back = getfilms(filmfolder)[0][1] except: - filmname_back = filmname + filmname_back = filmname + if serverstate == 'on': + gonzopiserver(False) + gonzopiserver(True) #LEFT elif pressed == 'left': @@ -1749,6 +1754,9 @@ def main(): filmname_back = getfilms(filmfolder)[0][1] except: filmname_back = filmname + if serverstate == 'on': + gonzopiserver(False) + gonzopiserver(True) #RIGHT elif pressed == 'right': diff --git a/srv/gonzopiserver.py b/srv/gonzopiserver.py @@ -324,14 +324,16 @@ class films: else: unrenderedfilms.append(f[0]) allfilms.append(f[0]) - i = web.input(page=None, scene=None, shot=None, take=None, film=None) + i = web.input(page=None, scene=None, shot=None, take=None, film=None, randhash=None) if i.scene != None: shots = countshots(film, filmfolder, i.scene) takes = counttakes(film, filmfolder, i.scene, i.shot) if i.scene != None and i.shot != None: shots = countshots(film, filmfolder, i.scene) + if i.randhash == None: + randhash = hashlib.md5(str(random.getrandbits(256)).encode('utf-8')).hexdigest() scenes = countscenes(filmfolder, film) - return render.filmpage(allfilms, film, scenes, str, filmfolder, counttakes, countshots, shots, i.scene, takes, i.shot, i.take, checkvideo) + return render.filmpage(allfilms, film, scenes, str, filmfolder, counttakes, countshots, shots, i.scene, takes, i.shot, i.take, checkvideo, randhash) application = app.wsgifunc() diff --git a/srv/templates/filmpage.html b/srv/templates/filmpage.html @@ -1,4 +1,4 @@ -$def with (films, film, scenes, str, filmfolder, counttakes, countshots, shots, scene, takes, shot, take, checkvideo) +$def with (films, film, scenes, str, filmfolder, counttakes, countshots, shots, scene, takes, shot, take, checkvideo,randhash) $ video = '' $if take != None: <h1>$film | scene $scene | shot $shot | take $take</h1> @@ -21,11 +21,11 @@ $if video != '': $ picture = checkvideo(video,filmfolder,film,scene,shot,take) $if picture[1] == 'video': <video width="80%" controls> - <source src="$video" style="width:80%; max-width:500px;" type="video/mp4"> + <source src="$video?$randhash" style="width:80%; max-width:500px;" type="video/mp4"> Your brower is caput </video> $elif picture[0] != '': - <img style="width:80%;" src="$picture[0]"/> + <img style="width:80%;" src="$picture[0]?$randhash"/> $elif picture[1] == '': <pre>video not rendered</pre> <a href="">render now!</a> @@ -46,17 +46,17 @@ $if shot != None: $for t in range(takes): $ thumbnail_url = '/'+filmfolder + film + '/scene' + str(scene).zfill(3) + '/shot' + str(shot).zfill(3) + '/take' + str(t+1).zfill(3) + '.jpeg' <pre>take $str(t+1)</pre> - <a href="?scene=$scene&shot=$shot&take=${str(t+1)}"><img style="vertical-align:middle; width:80%; max-width:500px;" src="$thumbnail_url"/></a><br> + <a href="?scene=$scene&shot=$shot&take=${str(t+1)}"><img style="vertical-align:middle; width:80%; max-width:500px;" src="$thumbnail_url?$randhash"/></a><br> $elif scene != None: $for s in range(shots) <pre>shot $str(s+1)</pre> $ t = countshots(film, filmfolder, scene) $ p = counttakes(film, filmfolder, scene, s+1) $ thumbnail_url = '/'+filmfolder + film + '/scene' + str(scene).zfill(3) + '/shot' + str(s+1).zfill(3) + '/take' + str(p).zfill(3) + '.jpeg' - <a href="?scene=$scene&shot=${str(s+1)}"><img style="vertical-align:middle; width:80%; max-width:500px;" src="$thumbnail_url"/></a><br> + <a href="?scene=$scene&shot=${str(s+1)}"><img style="vertical-align:middle; width:80%; max-width:500px;" src="$thumbnail_url?$randhash"/></a><br> $else: $for s in range(scenes): <pre>scene $str(s+1)</pre> $ t = counttakes(film, filmfolder, s+1, 1) $ thumbnail_url = '/'+filmfolder + film + '/scene' + str(s+1).zfill(3) + '/shot001/take' + str(t).zfill(3) + '.jpeg' - <a href="?scene=${str(s+1)}"><img style="vertical-align:middle; width:80%; max-width:500px;" src="$thumbnail_url"/></a><br> + <a href="?scene=${str(s+1)}"><img style="vertical-align:middle; width:80%; max-width:500px;" src="$thumbnail_url?$randhash"/></a><br>