Skip to content

Commit

Permalink
2.0.3: 24hour clock, a few date adjustments.
Browse files Browse the repository at this point in the history
  • Loading branch information
MrMamen committed Oct 24, 2017
1 parent 3b80f23 commit 60b3b03
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "__MSG_appName__",
"short_name": "__MSG_appShortName__",
"version": "2.0.0",
"version": "2.0.3",
"manifest_version": 2,
"description": "__MSG_appDescription__",
"icons": {
Expand Down
4 changes: 2 additions & 2 deletions app/scripts/src/history-sync/components/activity-list-item.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default class ActivityListItem extends React.Component {
let traktDate, traktUrl, traktTitle;

if (trakt) {
traktDate = trakt.date ? trakt.date.format('MMMM Do YYYY, h:mm:ss a') : '-';
traktDate = trakt.date ? trakt.date.format('MMMM Do YYYY, HH:mm:ss') : '-';
traktUrl = trakt.season ? `https://trakt.tv/shows/${trakt.show.ids.slug}/seasons/${trakt.season}/episodes/${trakt.number}` : `https://trakt.tv/movies/${trakt.ids.slug}`;
if (trakt.show && trakt.title){
traktTitle = `${trakt.show.title}: ${trakt.title}`;
Expand All @@ -63,7 +63,7 @@ export default class ActivityListItem extends React.Component {
<span> / </span>
<span><a href={traktUrl} target='_blank'>Trakt.tv title: {traktTitle}</a></span>
<span className='mdl-list__item-text-body'>
NRK date: {nrk.date.format('MMMM Do YYYY, h:mm:ss a')} / Trakt.tv date: {traktDate}
NRK date: {nrk.date.format('MMMM Do YYYY, HH:mm:ss')} / Trakt.tv date: {traktDate}
<br />
NRK progress: {nrk.progress.percentageWatched}%
<br />
Expand Down
6 changes: 3 additions & 3 deletions app/scripts/src/history-sync/utils/nrk-web-api-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class NRKWebAPIUtils {

static parseActivity(activity) {
const program = activity.program;
const date = moment(activity.lastSeen.at);
const date = moment(activity.lastSeen.at).add(2, "h"); //NRK timestamp is in GMT
let item;
const type = program.programType === 'Episode' ? 'show' : 'movie';

Expand Down Expand Up @@ -77,8 +77,8 @@ export default class NRKWebAPIUtils {
}

return new Promise((resolve, reject) => {
let NRK = Object.assign(item, { id: program.id, progress: activity.lastSeen });
TraktWebAPIUtils.getActivity({ item, date }).then(resolve).catch(resolve);
Object.assign(item, { id: program.id, progress: activity.lastSeen });
TraktWebAPIUtils.getActivity({ item, date }).then(resolve).catch(reject);
});
}
}

0 comments on commit 60b3b03

Please sign in to comment.