Skip to content

Commit

Permalink
Feature/fix schedule (#9791)
Browse files Browse the repository at this point in the history
* schedule: Fix banner and poster layouts used with network sorting.

* Don't offset the weekday

* Fix shows in schedule not showing under "Sunday".

* Fix key warning. On for loop.
  • Loading branch information
p0psicles authored Aug 13, 2021
1 parent 10be933 commit b496018
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 12 deletions.
3 changes: 2 additions & 1 deletion medusa/show/coming_episodes.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,8 @@ def get_coming_episodes(categories, sort, group, paused=app.COMING_EPS_DISPLAY_P
result['qualityValue'] = result['quality']
result['quality'] = get_quality_string(result['quality'])
result['airs'] = sbdatetime.sbftime(result['localtime'], t_preset=timeFormat).lstrip('0').replace(' 0', ' ')
result['weekday'] = 1 + date.fromordinal(result['airdate']).weekday()
# Monday - Sunday (0 - 6)
result['weekday'] = date.fromordinal(result['airdate']).weekday()
result['tvdbid'] = result['indexer_id']
result['airdate'] = sbdatetime.sbfdate(result['localtime'], d_preset=dateFormat)
result['localtime'] = result['localtime'].toordinal()
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/src/components/history-compact.vue
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@
</template>
<img v-else-if="row.statusName ==='Failed'" src="images/no16.png"
width="16" height="16" style="vertical-align:middle;"
v-tooltip.right="`${row.provider.name} download failed: ${row.resource} (${row.actionDate})`"
v-tooltip.right="`${row.provider.name} download failed: ${row.resource} (${fuzzyParseDateTime(row.actionDate)})`"
>
</div>
</span>
Expand Down
2 changes: 1 addition & 1 deletion themes-default/slim/src/components/schedule/calendar.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<div class="day-column" v-for="day in groupedSchedule" :key="day.airdate">
<span class="day-header" :title="day.airdate ? `airs ${day.airdate}` : 'No shows for this day'">{{day.header}}</span>
<ul v-if="day.episodes.length > 0">
<li v-for="episode in day.episodes" :key="episode.episodeSlug" class="calendar-show">
<li v-for="episode in day.episodes" :key="`${episode.showSlug}${episode.episodeSlug}`" class="calendar-show">
<div class="poster">
<app-link :title="episode.showName" :href="`home/displayShow?showslug=${episode.showSlug}`">
<asset default-src="images/poster.png" :show-slug="episode.showSlug" type="posterThumb" :link="false" />
Expand Down
6 changes: 3 additions & 3 deletions themes-default/slim/src/store/modules/schedule.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ const getters = {
if (!weekDay) {
weekDay = {
airdate: episode.airdate,
header: days[episode.weekday - 1],
header: days[episode.weekday],
class: 'soon',
episodes: []
};
Expand All @@ -161,7 +161,7 @@ const getters = {
missed, today, soon, later
} = state;
const { displayPaused } = rootState.config.layout.comingEps;
const days = ['Sunday', 'Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday'];
const days = ['Monday', 'Tuesday', 'Wednesday', 'Thursday', 'Friday', 'Saturday', 'Sunday'];
const newArray = [];

if (sort === 'date') {
Expand Down Expand Up @@ -212,7 +212,7 @@ const getters = {

if (sort === 'network') {
const { getScheduleFlattened } = getters;
const filteredSchedule = getScheduleFlattened.filter(item => item.paused || displayPaused);
const filteredSchedule = getScheduleFlattened.filter(item => !item.paused || displayPaused);

for (const episode of filteredSchedule.sort((a, b) => a.network.localeCompare(b.network))) {
let network = newArray.find(item => item.header === episode.network);
Expand Down
Loading

0 comments on commit b496018

Please sign in to comment.