jansmolders86 / mediacenterjs

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

Music not working #86

Closed niclashoyer closed 10 years ago

niclashoyer commented 10 years ago

After installing and configuring the path to my music files I get the following error everytime I try to access music:

MediacenterJS listening on port:3000

Screen ready...
Current version up to date.
Screen ready...
Screen ready...
Current version up to date.
Screen ready...
Database error: Error: Error: near line 1: no such table: albums
jansmolders86 commented 10 years ago

Hej niclas,

Thanks for reporting this issue. From what I can tell from the log, I have the strong suspicion you updated an older version of MCJS resulting in an incompatible database.

The fix should be easy: 1) Make sure the server is not running. 2) Browse to the lib folder from the root directory of MCJS and delete the database folder and its contents. A new database will be created automatically once you start the server again and the problem should be solved.

If not, please let me know so I can help sort this out.

Thanks for trying out the project and taking the time to report this!

niclashoyer commented 10 years ago

I just cloned the repo. I never had mediacenterjs running before. Nevertheless I deleted the database, but the error is the same (I'm using an up to date master branch).

right after deleting the database if I start the server and browse to music:

MediacenterJS listening on port:3000

Screen ready...
Current version up to date.
Screen ready...
Database error: Error: Error: near line 1: no such table: albums

util.print: Use console.log instead
/home/niclas/Entwicklung/Upstream/mediacenterjs/apps/music/music-functions.js:118
            if (typeof rows !== 'undefined' && rows.length > 0){
                                                   ^
TypeError: Cannot read property 'length' of null
    at EventEmitter.<anonymous> (/home/niclas/Entwicklung/Upstream/mediacenterjs/apps/music/music-functions.js:118:52)
    at Socket.onerror (/home/niclas/Entwicklung/Upstream/mediacenterjs/node_modules/dblite/build/dblite.node.js:225:16)
    at Socket.EventEmitter.emit (events.js:104:17)
    at readableAddChunk (_stream_readable.js:156:16)
    at Socket.Readable.push (_stream_readable.js:123:10)
    at Pipe.onread (net.js:520:20)
Child process exited

I think that music-functions.js:118 is just a follow up error of no such table: albums. The sqlite file contains the tables devices and progressionmarker.

Is there any information I can provide to help debugging this?

jansmolders86 commented 10 years ago

Thanks for your patience and helping me solve this issue! I have two question I would like to ask so I can figure out why this error occurs:

niclashoyer commented 10 years ago

I'm using Fedora 20 x86_64 with Linux 3.13.

The folder I'm trying to index contains roughly 50GB of music encoded as flac.

jansmolders86 commented 10 years ago

Hej,

I just pushed a potential fix. I got the same error on Ubuntu, and from there I was able to get it to work again. I have one issue left being that the frontend was not updated the first time the index was completed (looking into that as well of course). But other than that I had no errors.

Only one thing though, FLAC files are not supported yet I'm afraid. In favor of not having to transcode MP3 I have not yet implemented FLAC support. Of course I will do so in the near future.

I hope this fixed the issue though! Thanks again for trying it out and helping me (hopefully) solve this issue!

niclashoyer commented 10 years ago

Yes, the error is now gone, the files got scanned. FLAC is not supported, but I tried it with some mp3's. Now I get errors about missing id3 information (album), but I guess the relevant id3 tags have to be set? I'll report a new issue if I find something.

jansmolders86 commented 10 years ago

If no ID3 tags or partial ID3 tags are found, a warning is shown and placeholder data is used. Hopefully though, this is a small portion of your collection. :)

Thanks again!