hermanho / MMM-GooglePhotos

Display your photos on MagicMirror from Google Photos.
MIT License
170 stars 65 forks source link

Config.js Issue #32

Closed Zpider23 closed 4 years ago

Zpider23 commented 5 years ago

Here is the error: `WARNING! Could not validate config file. Starting with default configuration. Please correct syntax errors at or above this line: /home/pi/MagicMirror/config/config.js:164 module: "MMM-GooglePhotos", ^^^^^^^^^^^^^^^^^^

SyntaxError: Unexpected string at new Script (vm.js:74:7) at createScript (vm.js:246:10) at Object.runInThisContext (vm.js:298:10) at Module._compile (internal/modules/cjs/loader.js:678:28) at Object.Module._extensions..js (internal/modules/cjs/loader.js:722:10) at Module.load (internal/modules/cjs/loader.js:620:32) at tryModuleLoad (internal/modules/cjs/loader.js:559:12) at Function.Module._load (internal/modules/cjs/loader.js:551:3) at Module.require (internal/modules/cjs/loader.js:658:17) at require (internal/modules/cjs/helpers.js:20:18) `

Here is the part of the config.js file:

` module: "weatherforecast", position: "top_right", header: "Weather Forecast", config: { location: "New York", locationID: "5128581", //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city appid: "YOUR_OPENWEATHER_API_KEY" } },

]

}, { module: "MMM-GooglePhotos", position: "top_right", config: { albumId: ["AEt1YzuZGt8nJSGfLaXwkg074eaO7PlwTcyEiA5e_waSeE0xCCsMAgW104vwOBtdcVm_deXB4cdN"], // your album id(s) from result of auth_and_test.js refreshInterval: 100060,
scanInterval: 1000
60*10, // too many scans might cause API quota limit also. //note(2018-07-29). It is some weird. API documents said temporal image url would live for 1 hour, but it might be broken shorter. So, per 10 min scanning could prevent dead url.

    sort: "time", //'time', 'reverse', 'random'
    showWidth: "800px", // how large the photo will be shown as. (e.g;'100%' for fullscreen)
    showHeight: "600px",
    originalWidthPx: 800, // original size of loaded image. (related with image quality)
    originalHeightPx: 600, // Bigger size gives you better quality, but can give you network burden.
    mode: "hybrid", // "cover" or "contain" (https://www.w3schools.com/cssref/css3_pr_background-size.asp)
    //ADDED. "hybrid" : if you set as "hybrid" it will change "cover" and "contain" automatically by aspect ratio.
}

};`

I double checked that that is the name of the file. I don't know what it is. I've been having problems with config.

eouia commented 5 years ago

Error says you might have some error(mistypo) in line 164 of config.js. You might be probably missing some comma or bracket over the line 164.