Browse Source

[templates] Fix album use and local_timestamp

Colin Powell 3 days ago
parent
commit
fd36034f6d

+ 1 - 1
vrobbler/templates/base.html

@@ -297,7 +297,7 @@
                                 <p><a href="{{scrobble.media_obj.get_absolute_url}}">{{scrobble.media_obj.title}}</a></p>
                                 {% if scrobble.media_obj.subtitle %}<p><em><a href="{{scrobble.media_obj.subtitle.get_absolute_url}}">{{scrobble.media_obj.subtitle}}</a></em></p>{% endif %}
                                 {% if scrobble.logdata %}{% if scrobble.logdata.description %}<p><em>{{scrobble.logdata.description}}</em></p>{% endif %}{% endif %}
-                                <p><small>{{scrobble.timestamp|naturaltime}} from {{scrobble.source}}</small></p>
+                                <p><small>{{scrobble.local_timestamp|naturaltime}} from {{scrobble.source}}</small></p>
                                 <div class="progress-bar" style="margin-right:5px;">
                                     <span class="progress-bar-fill" style="width: {{scrobble.percent_played}}%;"></span>
                                 </div>

+ 1 - 1
vrobbler/templates/beers/beer_detail.html

@@ -57,7 +57,7 @@
                 <tbody>
                     {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                     </tr>
                     {% endfor %}
                 </tbody>

+ 1 - 1
vrobbler/templates/boardgames/boardgame_detail.html

@@ -62,7 +62,7 @@
                 <tbody>
                     {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                         <td>{{scrobble.media_obj.publisher}}</td>
                         <td>{% if scrobble.screenshot%}<img src="{{scrobble.screenshot.url}}" width=250 />{% endif %}</td>
                     </tr>

+ 1 - 1
vrobbler/templates/books/book_detail.html

@@ -52,7 +52,7 @@
                 <tbody>
                     {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                         <td>{% if scrobble.long_play_complete == True %}Yes{% endif %}</td>
                         <td>{% if scrobble.in_progress %}Now reading{% else %}{{scrobble.session_pages_read}}{% endif %}</td>
                         <td>{% for author in scrobble.book.authors.all %}<a href="{{author.get_absolute_url}}">{{author}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>

+ 1 - 1
vrobbler/templates/locations/geolocation_detail.html

@@ -62,7 +62,7 @@
                 <tbody>
                     {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}
                     <tr>
-                        <td>{{scrobble.timestamp|naturaltime}}</td>
+                        <td>{{scrobble.local_timestamp|naturaltime}}</td>
                     </tr>
                     {% endfor %}
                 </tbody>

+ 1 - 1
vrobbler/templates/moods/mood_detail.html

@@ -28,7 +28,7 @@
             <tbody>
                 {% for scrobble in object.scrobble_set.all %}
                 <tr>
-                    <td>{{scrobble.timestamp}}</td>
+                    <td>{{scrobble.local_timestamp}}</td>
                 </tr>
                 {% endfor %}
             </tbody>

+ 2 - 2
vrobbler/templates/music/album_detail.html

@@ -49,7 +49,7 @@
                 </tr>
             </thead>
             <tbody>
-                {% for track in object.tracks %}
+                {% for track in object.tracks.all %}
                 <tr>
                     <td>{{rank}}#1</td>
                     <td><a href="{{track.get_absolute_url}}">{{track.title}}</a></td>
@@ -82,7 +82,7 @@
             <tbody>
                 {% for scrobble in object.scrobbles %}
                 <tr>
-                    <td>{{scrobble.timestamp}}</td>
+                    <td>{{scrobble.local_timestamp}}</td>
                     <td><a href="{{scrobble.track.get_absolute_url}}">{{scrobble.track.title}}</a></td>
                     <td><a href="{{scrobble.track.artist.get_absolute_url}}">{{scrobble.track.artist.name}}</a></td>
                 </tr>

+ 3 - 3
vrobbler/templates/music/artist_detail.html

@@ -54,7 +54,7 @@
                 <tr>
                     <td>#{{track.0}}</td>
                     <td><a href="{{track.1.get_absolute_url}}">{{track.1.title}}</a></td>
-                    <td><a href="{{track.1.album.get_absolute_url}}">{{track.1.album}}</a></td>
+                    <td><a href="{{track.1.primary_album.get_absolute_url}}">{{track.1.primary_album}}</a></td>
                     <td>{{track.1.scrobble_count}}</td>
                     <td>
                         <div class="progress-bar" style="margin-right:5px;">
@@ -83,9 +83,9 @@
             <tbody>
                 {% for scrobble in object.scrobbles %}
                 <tr>
-                    <td>{{scrobble.timestamp}}</td>
+                    <td>{{scrobble.local_timestamp}}</td>
                     <td><a href="{{scrobble.track.get_absolute_url}}">{{scrobble.track.title}}</a></td>
-                    <td><a href="{{scrobble.track.album.get_absolute_url}}">{{scrobble.track.album.name}}</a></td>
+                    <td><a href="{{scrobble.track.primary_album.get_absolute_url}}">{{scrobble.track.primary_album.name}}</a></td>
                 </tr>
                 {% endfor %}
             </tbody>

+ 4 - 4
vrobbler/templates/music/track_detail.html

@@ -4,8 +4,8 @@
 
 {% block lists %}
 <div class="row">
-    {% if track.album.cover_image %}
-    <p style="width:150px; float:left;"><img src="{{track.album.cover_image.url}}" width=150 height=150 /></p>
+    {% if track.primary_image_url %}
+    <p style="width:150px; float:left;"><img src="{{track.primary_image_url}}" width=150 height=150 /></p>
     {% endif %}
 </div>
 <div class="row">
@@ -28,9 +28,9 @@
                 <tbody>
                     {% for scrobble in object.scrobble_set.all %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                         <td><a href="{{scrobble.track.get_absolute_url}}">{{scrobble.track.title}}</a></td>
-                        <td><a href="{{scrobble.track.album.get_absolute_url}}">{{scrobble.track.album}}</a></td>
+                        <td><a href="{{scrobble.track.primary_album.get_absolute_url}}">{{scrobble.track.primary_album}}</a></td>
                         <td><a href="{{scrobble.track.artist.get_absolute_url}}">{{scrobble.track.artist}}</a></td>
                     </tr>
                     {% endfor %}

+ 1 - 1
vrobbler/templates/podcasts/podcast_detail.html

@@ -45,7 +45,7 @@
                 <tbody>
                     {% for scrobble in scrobbles.all %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                         <td>{{scrobble.podcast_episode}}</td>
                     </tr>
                     {% endfor %}

+ 1 - 1
vrobbler/templates/scrobbles/_row.html

@@ -1,7 +1,7 @@
 {% load humanize %}
 {% load naturalduration %}
 <tr {% if scrobble.in_progress %}class="in-progress"{% endif %}>
-    <td>{% if scrobble.in_progress %}{{scrobble.media_obj.strings.verb}} now | <a class="right" href="{% url "scrobbles:finish" scrobble.uuid %}">Finish</a>{% else %}{{scrobble.timestamp|naturaltime}}{% endif %}</td>
+    <td>{% if scrobble.in_progress %}{{scrobble.media_obj.strings.verb}} now | <a class="right" href="{% url "scrobbles:finish" scrobble.uuid %}">Finish</a>{% else %}{{scrobble.local_timestamp|naturaltime}}{% endif %}</td>
     <td>
         {% if scrobble.media_type == "Task" %}
         <p><em><a href="{{scrobble.media_obj.get_absolute_url}}">{{scrobble.media_obj.title|truncatechars_html:45}} - {% if scrobble.logdata %}{% if scrobble.logdata.description %}{{scrobble.logdata.description}}{% endif %}{% endif %}</a></em></p>

+ 1 - 1
vrobbler/templates/scrobbles/import_detail.html

@@ -22,7 +22,7 @@
                 <tbody>
                     {% for scrobble in object.scrobbles %}
                     <tr>
-                        <td><a href="{{scrobble.get_absolute_url}}">{{scrobble.timestamp}}</a></td>
+                        <td><a href="{{scrobble.get_absolute_url}}">{{scrobble.local_timestamp}}</a></td>
                         <td>{{scrobble.media_type}}</td>
                         <td>{{scrobble.media_obj}}
                     </tr>

+ 1 - 1
vrobbler/templates/scrobbles/scrobble_archive_year.html

@@ -19,7 +19,7 @@
                     <tbody>
                         {% for scrobble in object_list %}
                         <tr>
-                            <td>{{scrobble.timestamp|naturaltime}}</td>
+                            <td>{{scrobble.local_timestamp|naturaltime}}</td>
                             <td><a href="{{scrobble.media_obj.get_absolute_url}}">{{scrobble.media_obj}}</a></td>
                             <td>{{scrobble.media_type}}</td>
                         </tr>

+ 1 - 1
vrobbler/templates/sports/sportevent_detail.html

@@ -20,7 +20,7 @@
                 <tbody>
                     {% for scrobble in object.scrobble_set.all %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                         <td>{{scrobble.media_obj.round.season.name}}</td>
                         <td>{{scrobble.media_obj.round.season.league}}</td>
                     </tr>

+ 1 - 1
vrobbler/templates/tasks/task_detail.html

@@ -59,7 +59,7 @@
                 <tbody>
                     {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                         <td><a href="{{scrobble.get_media_source_url}}">{{scrobble.logdata.description}}</a></td>
                         <td>{{scrobble.source}}</td>
                         <td>{{scrobble.log.notes}}</td>

+ 1 - 1
vrobbler/templates/trails/trail_detail.html

@@ -57,7 +57,7 @@
                 <tbody>
                     {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                     </tr>
                     {% endfor %}
                 </tbody>

+ 1 - 1
vrobbler/templates/videogames/videogame_detail.html

@@ -88,7 +88,7 @@
                 <tbody>
                     {% for scrobble in object.scrobble_set.all|dictsortreversed:"timestamp" %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local-timestamp}}</td>
                         <td>{% if scrobble.long_play_complete == True %}Yes{% else %}Not yet{% endif %}</td>
                         <td>{% if scrobble.in_progress %}Now playing{% else %}{{scrobble.playback_position_seconds|natural_duration}}{% endif %}</td>
                         <td>{% for platform in scrobble.video_game.platforms.all %}<a href="{{platform.get_absolute_url}}">{{platform}}</a>{% if not forloop.last %}, {% endif %}{% endfor %}</td>

+ 1 - 1
vrobbler/templates/videos/series_detail.html

@@ -60,7 +60,7 @@
                 <tbody>
                     {% for scrobble in scrobbles %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                         <td><a href="{{scrobble.media_obj.get_absolute_url}}">{{scrobble.media_obj.title}}</a></td>
                         <td>{{scrobble.media_obj.season_number}}</td>
                         <td>{{scrobble.media_obj.episode_number}}</td>

+ 1 - 1
vrobbler/templates/videos/video_detail.html

@@ -87,7 +87,7 @@ dd {
                 <tbody>
                     {% for scrobble in object.scrobble_set.all %}
                     <tr>
-                        <td>{{scrobble.timestamp}}</td>
+                        <td>{{scrobble.local_timestamp}}</td>
                     </tr>
                     {% endfor %}
                 </tbody>

+ 1 - 1
vrobbler/templates/webpages/webpage_detail.html

@@ -53,7 +53,7 @@
             <tbody>
                 {% for scrobble in object.scrobble_set.all %}
                 <tr>
-                    <td>{{scrobble.timestamp}}</td>
+                    <td>{{scrobble.local_timestamp}}</td>
                 </tr>
                 {% endfor %}
             </tbody>