jansmolders86 / mediacenterjs

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

Database table 'tvshows' could not be found #109

Closed TheSisb closed 10 years ago

TheSisb commented 10 years ago

I'm getting the following error when I click the "TV" plugin:

Database error: Error: near line 2: no such table: tvshows

Meta gathering started: tv shows

/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:354

                var episodeSeason = episodeSeasonMatch[0].replace(/[sS]/,"")

                                               ^

TypeError: Cannot read property '0' of null
    at getEpisodeData (/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:354:55)
    at getDataForStoredShow (/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:111:5)
    at getMetadataForTvShow (/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:97:5)
    at originalTitle (/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:71:9)
    at Walker.<anonymous> (/home/shadi/mediacenterjs/lib/utils/file-utils.js:51:9)
    at Walker.EventEmitter.emit (events.js:92:17)
    at Walker._wNext (/home/shadi/mediacenterjs/node_modules/walk/lib/walk.js:255:10)
    at Walker._wNext (/home/shadi/mediacenterjs/node_modules/walk/lib/walk.js:250:17)
    at Walker._wNext (/home/shadi/mediacenterjs/node_modules/walk/lib/walk.js:250:17)
    at Walker._wOnEmitDone (/home/shadi/mediacenterjs/node_modules/walk/lib/walk.js:125:8)

Metadata fetching for tv complete...
Child process exited for:  tv
Metadata fetcher error:  { [Error: Command failed:
/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:354
                var episodeSeason = episodeSeasonMatch[0].replace(/[sS]/,"")
                                                      ^
TypeError: Cannot read property '0' of null
    at getEpisodeData (/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:354:55)
    at getDataForStoredShow (/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:111:5)
    at getMetadataForTvShow (/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:97:5)
    at originalTitle (/home/shadi/mediacenterjs/lib/utils/metadata/tv-metadata.js:71:9)
    at Walker.<anonymous> (/home/shadi/mediacenterjs/lib/utils/file-utils.js:51:9)
    at Walker.EventEmitter.emit (events.js:92:17)
    at Walker._wNext (/home/shadi/mediacenterjs/node_modules/walk/lib/walk.js:255:10)
    at Walker._wNext (/home/shadi/mediacenterjs/node_modules/walk/lib/walk.js:250:17)
    at Walker._wNext (/home/shadi/mediacenterjs/node_modules/walk/lib/walk.js:250:17)
    at Walker._wOnEmitDone (/home/shadi/mediacenterjs/node_modules/walk/lib/walk.js:125:8)
] killed: false, code: 8, signal: null }
Database error: Error: near line 4: no such table: tvshows

Could not index any tv shows, please check given movie collection path...

And for plugin "Movies" I get

Screen ready...
Database error: Error: near line 1: no such table: movies

Meta gathering started: Movies

Could not index any movies, please check given movie collection path

I checked the config.ini and my paths are full paths (/home/files/movies) and are valid.

My movies folder looks something like this: movies/Games/CS-GO-Jokes.mkv movies/Games/HoN-top-ten-plays.avi movies/old/wedding-2013.mp4 etc

My tv folder looks like: tv/Show Name/Show Name - 1x01 - Episode Title.mp4 And it also contains other files for each episode with the same name but different extensions such as Show Name/Show Name - 1x01 - Episode Title.idx Show Name/Show Name - 1x01 - Episode Title.jpg Show Name/Show Name - 1x01 - Episode Title.sub Show Name/Show Name - 1x01 - Episode Title.xml With various information about that specific episode.

So my question is how are the tables being created and consequently what is causing my installation to freak out? :P Thanks!

TheSisb commented 10 years ago

I believe these errors are due to how MediacenterJS is trying to parse my directory for shows / movies. Following the convention in the FAQ I got a movie to work the first time and then some other error occured - didn't look into it much. TV was much more difficult because I was looking for ways to adjust MediacenterJS versus renaming all of my files in a way I'm unfamiliar with. I couldn't find docs for it either.

I tried modifying the regex used for a few minutes and seemed to be on the right track (I had to clear the sqlite3 tables a few times in between). I think a better approach would be to allow users to specify the file name structure like how Sick Beard does it: http://puu.sh/8SEmg/6305c1107d.png. That's quite a bit of work to create but it would solve the issue for a wider range of users I think.

Ultimately my goal is to achieve something like: tvDir/Show Name/Show Name - 1x01 - Show title.ext

jansmolders86 commented 10 years ago

Hej there,

What a great feature that would be! I will definitely put this on the todo list. This would be a great feature for advanced users. The only thing I'm worried about is the transcoding support . Currently, the project only "finds" files that FFMPEG can handle, so that will be a bit of a hurdle. Of course the end goal is to support as many filetypes as possible. Thanks again for your help and this great idea!

jansmolders86 commented 10 years ago

I've added this feature as a todo card in the project's trello. https://trello.com/c/g3TzigYC/79-allow-users-to-specify-the-file-name-structure-like-how-sick-beard-does-it-http-puu-sh-8semg-6305c1107d-png

I'll close this issue and continue to work towards implementing that feature!

Thanks again!

TheSisb commented 10 years ago

Ah didn't know you had a Trello going, very cool! I hope to contribute more to this project in the near future :+1:

jansmolders86 commented 10 years ago

Cool! I look forward to it! :)