Commit c4b71179 authored by Tankypon's avatar Tankypon

Some new things that are not done

parent ac0fb5c7
......@@ -130,7 +130,7 @@ def sch2html(keywords, serie=False):
return html
def getseriestuff(keywords, year, extrawords='', user='', searchengine="torrentz"):
def getseriestuff(keywords, year, user=''):
serie_stuff = ''
r = OMDBbAPI.search_by_title(keywords, year)
if r['Response'] == 'True':
......@@ -147,13 +147,12 @@ def getseriestuff(keywords, year, extrawords='', user='', searchengine="torrentz
for e in season['Episodes']:
episode = 'S{0:02d}E{1:02d}'.format(int(season['Season']), int(e['Episode']))
search = '{0} {1}'.format(keywords, episode)
link = '/search?keywords={}&extrawords={}&nocatalog=1&isserie=1&searchengine={}'.format(
search, extrawords, searchengine)
link = '/search?&isserie=1'.format(search)
serie_stuff += '<tr>\n'
serie_stuff += '<td class="text-center"><a href="{}">{:02d}</a></td>\n'.format(
link, int(season['Season']))
serie_stuff += '<td class="text-center"><a href="{}">{:02d}</a></td>\n'.format(link, int(e['Episode']))
serie_stuff += '<td><a href="{}">{}</a></td>\n'.format(link, e['Title'])
serie_stuff += '<td><a id="submit" href="{}">{}</a></td>\n'.format(link, e['Title'])
serie_stuff += '<td class="text-right"><a href="{}">{}</a></td>\n'.format(link, e['Released'])
with DontPanicDB() as db:
......@@ -246,32 +245,44 @@ def watchlist(user):
date = ele["datetime"]
title = ele["title"]
magnet = ele["magnet"]
video = str()
link_remove = quoteurl('/_removeinwatchlist/{}/'.format(title))
link_watch = quoteurl('/stream/{}/{}/{}'.format(title, magnet, 1 if watch["type"] == "serie" else 0))
video += '<td>{}</td>\n'.format(date)
video += '<td>{}</td>\n'.format(title)
actions = str()
if magnet:
actions += '<span class="float-right"><a href="{}">▷ {}</a></span>'.format(link_watch, _('Watch again'))
actions += '<span class="float-right"><a href="{}">✕ {}</a></span>'.format(link_remove, _('Remove'))
video += '<td>{}</td>\n'.format(actions)
video = '<tr>{}</tr>\n'.format(video)
if watch["type"] == "serie":
link_watch = quoteurl('/stream/{}/{}/1'.format(title, magnet))
series += '<li>\n'
series += '{} {}'.format(date, title)
if magnet != '':
series += '<span class="float-right"><a href="{}">▷ {}</a></span>'.format(link_watch,
_('Watch again'))
series += '<span class="float-right"><a href="{}">✕ {}</a></span>'.format(link_remove, _('Remove'))
series += '</li>\n'
series += video
else:
link_watch = quoteurl('/stream/{}/{}/0'.format(title, magnet))
movies += '<li>\n'
movies += '{} {}'.format(date, title)
if magnet != '':
movies += '<span class="float-right"><a href="{}">▷ {}</a></span>'.format(link_watch,
_('Watch again'))
movies += '<span class="float-right"><a href="{}">✕ {}</a></span>'.format(link_remove, _('Remove'))
movies += '</li>\n'
movies += video
if len(movies) > 0:
movies = '<ul style="list-style-type:square;">{}</ul>'.format(movies)
movies = """
<table style="padding-left: 30px;">
<thead>
<tr><th>{}</th><th>{}</th></tr>
</thead>
<tbody>{}</tbody>
</table>""".format(_("Date"), _("Title"), movies)
if len(series) > 0:
series = '<ul style="list-style-type:square;">{}</ul>'.format(series)
series = """
<table style="padding-left: 30px;">
<thead>
<tr><th>{}</th><th>{}</th></tr>
</thead>
<tbody>{}</tbody>
</table>""".format(_("Date"), _("Title"), series)
return movies, series
......@@ -524,6 +535,11 @@ class DontPanic:
whoami = request.get_cookie("username", secret=self.secret)
self._add_to_recent_search(whoami, title, year, poster, isserie)
if isserie:
whoami = request.get_cookie("username", secret=self.secret)
list_ep_serie = getseriestuff(title, year, user=whoami)
lang = locale.setlocale(locale.LC_ALL, "")[0:2] # 'fr' or 'en'
tplvars = {
'title': title,
......@@ -538,7 +554,8 @@ class DontPanic:
'lang': lang,
'rating': rating,
'html': html,
'isserie': isserie}
'isserie': isserie,
'list_ep_serie': list_ep_serie}
tplvars.update(tpl_msg)
return template('what', tplvars)
......
......@@ -75,7 +75,7 @@ main {
}
ul li {
list-style: none;
list-style: initial;
padding-left: 20px;
margin-bottom: 0.2em;
}
......@@ -131,8 +131,9 @@ th { font-weight: bold; }
tr { width: 100%; }
td { text-align: left; padding: 0 10px 0 10px;}
tfoot { font-style: italic; }
tr:hover { background: #cccccc; text-shadow: none}
tr:hover { background: #cccccc; text-shadow: none; }
tr:hover a { color: #111111; }
tbody:hover tr { color: #111111; }
td a { display: block; }
/* to show posters */
......@@ -140,8 +141,7 @@ td a { display: block; }
.ca-menu li{
display: inline-block;
width: 200px;
height: 150px;
width: 185px;
margin: 20px auto;
}
......@@ -185,6 +185,10 @@ div.show-image a.delete {
margin-right: 25px;
}
div#scroll { padding-right: 8px; }
div.row div p { margin-bottom: 0.5em; }
aside.bottom {
position: relative;
bottom: 0;
......@@ -192,7 +196,7 @@ aside.bottom {
}
.plot {
margin: 10px;
margin: 20px auto;
padding: 10px;
border: 1px #ccc dotted;
}
......
......@@ -14,7 +14,6 @@ Suggestion:
- Lorsque utilisateur choisit une vidéo: le titre de la vidéo est celui de sa recherche, plus logique d'afficher le nom de la vidéo
- Lorsque la vidéo est stocké dans la base de donnée, actuellement on stocke la recherche comme nom, plus logique de stocker le titre de la vidéo -> oui et non. On garde comme ça en mémoire aussi les différentes sources de vidéo qui peuvent être différentes d'une fois sur l'autre"
- Changer icone de la page en fonction de l'année, par exemple mettre un bonnet rouge comme VLC et d'autres logiciels lorsque période des fêtes de fin d'année
- Rendre plus esthétique, l'interface de la page de l'utilisateur (Idée: pour garder une cohérence avec la page résultat, mettre sous forme de colonne)
- Ajouter d'autres contenues comme les musiques (exemple: http://korben.info/torrent-tunes.html)
- Mettre à jour toutes les documentations sur les fonctions (PEP8)
- Faire les traductions es, de
......
......@@ -3,10 +3,7 @@
%include('head.tpl')
<body>
<header>
<div>
<h1>{{title}}</h1>
<h4>{{ year }}</h4>
</div>
<h1>{{title}}</h1>
<nav>
%include('backtomain.tpl')
......@@ -18,57 +15,106 @@
{{ html }}
%end
<div class="row">
<div class="col-5">
<img src="{{ poster }}">
</div>
<h4 class="text-center" style="margin-bottom: 15px">
<span>{{ year }}</span>
<span style="margin-left: 45px">Rating: {{ rating }} / 10</span>
</h4>
%if isserie == "0" :
<div class="row">
<div class="col-5 text-center">
<img src="{{ poster }}">
</div>
<div class="col-7">
<p>{{tpl_director}} {{director}}</p>
<p>{{tpl_writer}} {{writer}}</p>
<p>{{tpl_actors}} {{actors}}</p>
<p>{{ rating }} / 10</p>
<div class="col-7">
<p>{{tpl_director}} {{director}}</p>
<p>{{tpl_writer}} {{writer}}</p>
<p>{{tpl_actors}} {{actors}}</p>
<div class="plot">
<p class="text-justify">{{plot}}</p>
<div class="text-right">
<a href="https://translate.google.com/#en/{{lang}}/{{plot}}" target="_blank">
{{tpl_google_translate}}
</a>
<div class="plot">
<p class="text-justify">{{plot}}</p>
<div class="text-right">
<a href="https://translate.google.com/#en/{{lang}}/{{plot}}" target="_blank">
{{tpl_google_translate}}
</a>
</div>
</div>
</div>
%if isserie == "1" :
<form action="/serie/{{title}}/{{year}}" method="get">
%else:
<form action="/search" method="get">
<input name="keywords" type="hidden" value="{{title_simplify}}">
<input name="nocatalog" type="hidden" value="1">
%end
<ul>
<li>{{tpl_extrawords}}
<input name="extrawords" type="text" placeholder="vostfr">
</li>
<li>{{tpl_searchon}}
<select name="searchengine" size="1">
<option> btdigg
<option> kickasstorrents
<option> piratebay
<option> torrentproject
<option> torrentz
<option> {{tpl_all}}
</select>
</li>
</ul>
<p>{{tpl_extrawords}}
<input name="extrawords" type="text" placeholder="vostfr">
</p>
<p>{{tpl_searchon}}
<select name="searchengine" size="1">
<option> btdigg
<option> kickasstorrents
<option> piratebay
<option> torrentproject
<option> torrentz
<option> {{tpl_all}}
</select>
</p>
<div class="text-center">
<input value="{{tpl_watchnow}}" type="submit" class="big">
</div>
</form>
</div>
</div>
%else:
<div class="row">
<div class="col-5">
<div>
<img src="{{ poster }}" style="height: 300px; float: left; margin-right: 25px;">
<p>{{tpl_director}} {{director}}</p>
<p>{{tpl_writer}} {{writer}}</p>
<p>{{tpl_actors}} {{actors}}</p>
</div>
<div class="plot">
<p class="text-justify">{{plot}}</p>
<div class="text-right">
<a href="https://translate.google.com/#en/{{lang}}/{{plot}}" target="_blank">
{{tpl_google_translate}}
</a>
</div>
</div>
</div>
<div class="col-7">
<form action="/search" method="get">
<input name="keywords" type="hidden" value="{{title_simplify}}">
<input name="nocatalog" type="hidden" value="1">
<ul>
<li>{{tpl_extrawords}}
<input name="extrawords" type="text" placeholder="vostfr">
</li>
<li>{{tpl_searchon}}
<select name="searchengine" size="1">
<option> btdigg
<option> kickasstorrents
<option> piratebay
<option> torrentproject
<option> torrentz
<option> {{tpl_all}}
</select>
</li>
</ul>
{{!list_ep_serie}}
</form>
</div>
</div>
</div>
%end
</main>
% include('footer.tpl')
% include('scripts.tpl')
<script>
document.getElementById("submit").onclick = function() {
document.getElementById("submit").submit();
}
</script>
</body>
</html>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment