jansmolders86 / mediacenterjs

A HTML/CSS/Javascript (NodeJS) based Media center
http://mediacenterjs.com
1.29k stars 243 forks source link

Not streaming mp4 video file "copySync" not found #184

Closed ildac closed 9 years ago

ildac commented 9 years ago

First of all wonderful project! I started to do the same thing when i find out this and decided to kill my project and contribute to this.

I did clone the master repo, but then I find out a problem, playing an mp4 video (that don't need to be encode) will result in a nice dialog: "The episode undefined could not be found".

The log error is the following:

info: File is mp4, copieing local file to data folder so it can be accessed...

/Users/Dac/Documents/projects/mediacenterjs/node_modules/sqlite3/lib/trace.js:28
                    throw err;
                          ^
TypeError: Property 'copySync' of object #<Object> is not a function
    at /Users/Dac/Documents/projects/mediacenterjs/lib/handlers/video-playback.js:81:20
    at null.<anonymous> (/Users/Dac/Documents/projects/mediacenterjs/lib/handlers/video-playback.js:142:9)
    at emit (events.js:95:17)
    at module.exports.CustomEventEmitter.emit (/Users/Dac/Documents/projects/mediacenterjs/node_modules/sequelize/lib/emitters/custom-event-emitter.js:61:33)
    at null.<anonymous> (/Users/Dac/Documents/projects/mediacenterjs/node_modules/sequelize/lib/query-interface.js:981:19)
    at emit (events.js:95:17)
    at module.exports.CustomEventEmitter.emit (/Users/Dac/Documents/projects/mediacenterjs/node_modules/sequelize/lib/emitters/custom-event-emitter.js:61:33)
    at module.exports.onSuccess (/Users/Dac/Documents/projects/mediacenterjs/node_modules/sequelize/lib/dialects/sqlite/query.js:181:10)
    at Statement.<anonymous> (/Users/Dac/Documents/projects/mediacenterjs/node_modules/sequelize/lib/dialects/sqlite/query.js:52:25)
--> in Database#all('SELECT * FROM `ProgressionMarkers` WHERE `ProgressionMarkers`.`EpisodeId`=2 LIMIT 1;', [Function])
    at executeSql (/Users/Dac/Documents/projects/mediacenterjs/node_modules/sequelize/lib/dialects/sqlite/query.js:43:54)
    at /Users/Dac/Documents/projects/mediacenterjs/node_modules/sequelize/node_modules/lodash/dist/lodash.js:5143:23
    at Statement.<anonymous> (/Users/Dac/Documents/projects/mediacenterjs/node_modules/sequelize/lib/dialects/sqlite/query.js:80:17)

I looked around a bit and find out that the "fs.extra" lib actually does not have "copySync" method for real, because it is dependent from an older "fs-extra: ~0.6.1" lib that didn't had this method, something similar like "CopyFileSync" is present. A temp fix was to update the dependency of "fs.extra" lib to the last "fs-extra: 0.15.0" and add the method export, but "fs.extra" seems to be no more actively maintained.

I know I'm the newcomer, but there is something in "fs.extra" that it's not in "fs-extra", can we consider switching the lib?

jansmolders86 commented 9 years ago

Thanks a lot for checking out the project and your kind words! I completely agree we should just switch to fs-extra! I'' going to check if everything still works after the switch and then well be good to go!

ildac commented 9 years ago

If you want I've practically already did the switch, I can test a bit and if all works well do a pull request in the weekend.

jansmolders86 commented 9 years ago

That would be reallly awesome as I'm swamped with work atm. Thanks a bunch!