From fa0152f109171cc458699ea83343ab5e75d1a8be Mon Sep 17 00:00:00 2001 From: Benji Encalada Mora Date: Mon, 9 Jan 2023 17:06:04 -0600 Subject: [PATCH 1/2] fix: add featured and cleanup input --- src/js/Editors/MovieEditor.js | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/js/Editors/MovieEditor.js b/src/js/Editors/MovieEditor.js index bb213c5..a1074cc 100644 --- a/src/js/Editors/MovieEditor.js +++ b/src/js/Editors/MovieEditor.js @@ -6,6 +6,7 @@ import Rating from '../Components/Rating' import Proxy from '../Controllers/Proxy' const OMDB_API_KEY = import.meta.env.VITE_OMDB_API_KEY +const IMDB_URL = 'https://imdb.com/title/' const MovieEditor = () => { if (!OMDB_API_KEY) { @@ -30,18 +31,23 @@ const MovieEditor = () => { } const rating = ratingToStars() + const title = `${state.rewatched ? 'Rewatched' : 'Watched'} ${state.movie.Title}, (${state.movie.Year})${rating ? ' - ' + rating : ''}` const properties = { - summary: [ `${state.rewatched ? 'Rewatched' : 'Watched'} ${state.movie.Title}, (${state.movie.Year})${rating ? ' - ' + rating : ''}` ], + name: [ title ], + summary: [ title ], + featured: [ state.movie.Poster ], 'u-watch-of': [ { 'type': [ 'h-cite' ], 'properties': { - title: [ state.movie.Title ], + name: [ state.movie.Title ], + photo: [ state.movie.Poster ], + uid: [ `imdb:${state.movie.imdbID}` ], + url: [ `${IMDB_URL}${state.movie.imdbID}` ], + // custom properties year: [ state.movie.Year ], - imdbID: [ state.movie.imdbID ], - poster: [ state.movie.Poster ], - rewatch: state.rewatched === true ? true : false, - ...(state.rate && { rating: state.rating }) + rewatch: [ state.rewatched === true ], + ...(state.rate && { rating: [ state.rating ] }) } } ] From 653b61b11d75a02fac4d618d2d700cdedc900b15 Mon Sep 17 00:00:00 2001 From: Benji Encalada Mora Date: Mon, 9 Jan 2023 17:06:32 -0600 Subject: [PATCH 2/2] build: v0.1.7 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index e51d850..55c3bb0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "sparkles", - "version": "0.1.6", + "version": "0.1.7", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "sparkles", - "version": "0.1.6", + "version": "0.1.7", "license": "MIT", "dependencies": { "cheerio": "^1.0.0-rc.12", diff --git a/package.json b/package.json index b7cc2b0..56770b4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "sparkles", - "version": "0.1.6", + "version": "0.1.7", "description": "micropub client", "main": "./src/js/app.js", "scripts": {