RE: [MYSQL] HOW-TO: 5 User XBMC - BigMong - 2016-02-03
(2016-01-24, 21:00)horstepipe Wrote: hey BigMong I exactly followed your instructions without SQL errors.
Main-database works, but user-database stays empty.
In Kodi log I have the following error:
19:57:56 T:12264 ERROR: CVideoDatabase::GetMoviesByWhere failed
any ideas? @horstepipe
What's the databases you are pointing to for the users? in your advancedsettings.xml you need this file for each user/profile
EG:
Main
PHP Code: <videodatabase> <type>mysql</type> <host>192.168.0.110</host> <port>3306</port> <user>KODI</user> <pass>****</pass> <name>Kodi_Matt_Video_</name> </videodatabase>
User
PHP Code: <videodatabase> <type>mysql</type> <host>192.168.0.110</host> <port>3306</port> <user>KODI</user> <pass>****</pass> <name>Kodi_Mace_Video_</name> </videodatabase>
The other thing It might be is the files table, you should have a "globalfiles" table under you main user this table will have the cols for each user
then you should have a view "files" and this is maped for all users to the main "globalfiles" table and the right col for each user
if you look in your sql the other users in the view "files" you should see the data for the user. This SQL should give you the data too
PHP Code: SELECT * FROM `Kodi_Mace_Video_93`.`globalfiles`
Hope this Helps
RE: [MYSQL] HOW-TO: 5 User XBMC - apeg - 2016-02-07
Thanks BigMong, just used your 93 instructions and its working perfect.
RE: [MYSQL] HOW-TO: 5 User XBMC - BigMong - 2016-02-24
Awesome, I will look into doing Jarvis and posting the SQL for that setup
RE: [MYSQL] HOW-TO: 5 User XBMC - birt - 2016-02-26
(2016-02-24, 10:57)BigMong Wrote: Awesome, I will look into doing Jarvis and posting the SQL for that setup
Looking forward to that.
RE: [MYSQL] HOW-TO: 5 User XBMC - horstepipe - 2016-03-09
yeah, me too
RE: [MYSQL] HOW-TO: 5 User XBMC - BigMong - 2016-03-14
Ok here is a working setup for Database Version 99 [aka Jarvis]
Sorry for the delay.
My last post for a Database Version 93
This has only been Tested on a New Setup
I would say it will fail the update
I always start fresh with each update, My users Watch Status and Ratings are keeped in https://trakt.tv
Since the database now has user ratings I have created Global Episode,TV Show, and Movie
In my test on the laptop everything is working, I wont be upgrading my home setup yet (Waiting for something)
Please Note: If your Database login is different to KODI you must change it below
PHP Code: /*---------- --- PREP --- ----------*/ /* GLOBAL FILES */ RENAME TABLE `Kodi_Test_Matt_Video_99`.`files` TO `Kodi_Test_Matt_Video_99`.`globalfiles`; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` CHANGE playCount playCountMatt INT(11); ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` CHANGE lastPlayed lastPlayedMatt TEXT; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD playCountMace INT(11) AFTER lastPlayedMatt; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD lastPlayedMace TEXT AFTER playCountMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD playCountKiyana INT(11) AFTER lastPlayedMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD lastPlayedKiyana TEXT AFTER playCountKiyana; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD playCountJaide INT(11) AFTER lastPlayedKiyana; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD lastPlayedJaide TEXT AFTER playCountJaide;
CREATE VIEW `Kodi_Test_Matt_Video_99`.`files` AS SELECT `Kodi_Test_Matt_Video_99`.`globalfiles`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`idPath` AS `idPath`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`strFilename` AS `strFilename`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`playCountMatt` AS `playCount`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`lastPlayedMatt` AS `lastPlayed`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`dateAdded` AS `dateAdded` FROM `Kodi_Test_Matt_Video_99`.`globalfiles`;
/* GLOBAL EPISODE */ RENAME TABLE `Kodi_Test_Matt_Video_99`.`episode` TO `Kodi_Test_Matt_Video_99`.`globalepisode`; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalepisode` CHANGE userrating userratingMatt INT(11); ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalepisode` ADD userratingMace INT(11) AFTER userratingMatt; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalepisode` ADD userratingKiyana INT(11) AFTER userratingMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalepisode` ADD userratingJaide INT(11) AFTER userratingKiyana; CREATE VIEW `Kodi_Test_Matt_Video_99`.`episode` AS SELECT `Kodi_Test_Matt_Video_99`.`globalepisode`.`idEpisode` AS `idEpisode`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idShow` AS `idShow`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`userratingMatt` AS `userrating`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idSeason` AS `idSeason` FROM `Kodi_Test_Matt_Video_99`.`globalepisode`;
/* GLOBAL TV SHOW */ RENAME TABLE `Kodi_Test_Matt_Video_99`.`tvshow` TO `Kodi_Test_Matt_Video_99`.`globaltvshow`; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globaltvshow` CHANGE userrating userratingMatt INT(11); ALTER TABLE `Kodi_Test_Matt_Video_99`.`globaltvshow` ADD userratingMace INT(11) AFTER userratingMatt; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globaltvshow` ADD userratingKiyana INT(11) AFTER userratingMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globaltvshow` ADD userratingJaide INT(11) AFTER userratingKiyana;
CREATE VIEW `Kodi_Test_Matt_Video_99`.`tvshow` AS SELECT `Kodi_Test_Matt_Video_99`.`globaltvshow`.`idShow` AS `idShow`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`userratingMatt` AS `userrating` FROM `Kodi_Test_Matt_Video_99`.`globaltvshow`;
/* GLOBAL MOVIE */ RENAME TABLE `Kodi_Test_Matt_Video_99`.`movie` TO `Kodi_Test_Matt_Video_99`.`globalmovie`; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalmovie` CHANGE userrating userratingMatt INT(11); ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalmovie` ADD userratingMace INT(11) AFTER userratingMatt; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalmovie` ADD userratingKiyana INT(11) AFTER userratingMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalmovie` ADD userratingJaide INT(11) AFTER userratingKiyana; CREATE VIEW `Kodi_Test_Matt_Video_99`.`movie` AS SELECT `Kodi_Test_Matt_Video_99`.`globalmovie`.`idMovie` AS `idMovie`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`idSet` AS `idSet`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`userratingMatt` AS `userrating` FROM `Kodi_Test_Matt_Video_99`.`globalmovie`;
/* TRIGGER FIX FOR MULT USERS */ DROP TRIGGER IF EXISTS `Kodi_Test_Matt_Video_99`.`delete_file`; DELIMITER $$ /* REPLACE ---> KODI <--- WITH YOUR MYSQL LOGIN UID FROM THE ADVANCEDSETTINGS.XML */ CREATE DEFINER=`KODI`@`%` TRIGGER `Kodi_Test_Matt_Video_99`.`delete_file` AFTER DELETE ON `Kodi_Test_Matt_Video_99`.`globalfiles` FOR EACH ROW BEGIN DELETE FROM `Kodi_Test_Matt_Video_99`.bookmark WHERE idfile = old.idfile; DELETE FROM `Kodi_Test_Mace_Video_99`.bookmark WHERE idfile = old.idfile; DELETE FROM `Kodi_Test_Kiyana_Video_99`.bookmark WHERE idfile = old.idfile; DELETE FROM `Kodi_Test_Jaide_Video_99`.bookmark WHERE idfile = old.idfile; DELETE FROM settings WHERE idfile = old.idfile; DELETE FROM stacktimes WHERE idfile = old.idfile; DELETE FROM streamdetails WHERE idfile = old.idfile; END$$ DELIMITER ;
Here is one user setup, just find and replace to add more.
PHP Code: /*------------- --- USER 02 --- -------------*/ CREATE DATABASE IF NOT EXISTS Kodi_Test_Mace_Video_99 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
/* GLOBAL FILES LINK */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`files` AS SELECT `Kodi_Test_Matt_Video_99`.`globalfiles`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`idPath` AS `idPath`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`strFilename` AS `strFilename`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`playCountMace` AS `playCount`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`lastPlayedMace` AS `lastPlayed`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`dateAdded` AS `dateAdded` FROM `Kodi_Test_Matt_Video_99`.`globalfiles`;
/* GLOBAL EPISODE LINK */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`episode` AS SELECT `Kodi_Test_Matt_Video_99`.`globalepisode`.`idEpisode` AS `idEpisode`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idShow` AS `idShow`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`userratingMace` AS `userrating`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idSeason` AS `idSeason` FROM `Kodi_Test_Matt_Video_99`.`globalepisode`;
/* GLOBAL TV SHOW LINK */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`tvshow` AS SELECT `Kodi_Test_Matt_Video_99`.`globaltvshow`.`idShow` AS `idShow`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`userratingMace` AS `userrating` FROM `Kodi_Test_Matt_Video_99`.`globaltvshow`;
/* GLOBAL MOVIE LINK */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`movie` AS SELECT `Kodi_Test_Matt_Video_99`.`globalmovie`.`idMovie` AS `idMovie`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`idSet` AS `idSet`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`userratingMace` AS `userrating` FROM `Kodi_Test_Matt_Video_99`.`globalmovie`;
/* USER BOOKMARKS */ CREATE TABLE `Kodi_Test_Mace_Video_99`.`bookmark` ( `idBookmark` int(11) NOT NULL, `idFile` int(11) DEFAULT NULL, `timeInSeconds` double DEFAULT NULL, `totalTimeInSeconds` double DEFAULT NULL, `thumbNailImage` text, `player` text, `playerState` text, `type` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; ALTER TABLE `Kodi_Test_Mace_Video_99`.`bookmark` ADD PRIMARY KEY (`idBookmark`), ADD KEY `ix_bookmark` (`idFile`,`type`); ALTER TABLE `Kodi_Test_Mace_Video_99`.`bookmark` MODIFY `idBookmark` int(11) NOT NULL AUTO_INCREMENT;
/* USER VIEWS */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`actor` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`actor`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`actor_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`actor_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`art` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`art`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`country` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`country`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`country_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`country_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`director_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`director_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`genre` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`genre`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`genre_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`genre_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`movielinktvshow` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`movielinktvshow`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`musicvideo` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`musicvideo`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`path` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`path`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`seasons` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`seasons`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`sets` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`sets`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`settings` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`settings`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`stacktimes` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`stacktimes`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`streamdetails` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`streamdetails`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`studio` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`studio`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`studio_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`studio_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`tag` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`tag`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`tag_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`tag_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`tvshowlinkpath` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`tvshowlinkpath`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`version` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`version`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`writer_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`writer_link`;
CREATE VIEW `Kodi_Test_Mace_Video_99`.`episode_view` AS SELECT `episode`.`idEpisode` AS `idEpisode`, `episode`.`idFile` AS `idFile`, `episode`.`c00` AS `c00`, `episode`.`c01` AS `c01`, `episode`.`c02` AS `c02`, `episode`.`c03` AS `c03`, `episode`.`c04` AS `c04`, `episode`.`c05` AS `c05`, `episode`.`c06` AS `c06`, `episode`.`c07` AS `c07`, `episode`.`c08` AS `c08`, `episode`.`c09` AS `c09`, `episode`.`c10` AS `c10`, `episode`.`c11` AS `c11`, `episode`.`c12` AS `c12`, `episode`.`c13` AS `c13`, `episode`.`c14` AS `c14`, `episode`.`c15` AS `c15`, `episode`.`c16` AS `c16`, `episode`.`c17` AS `c17`, `episode`.`c18` AS `c18`, `episode`.`c19` AS `c19`, `episode`.`c20` AS `c20`, `episode`.`c21` AS `c21`, `episode`.`c22` AS `c22`, `episode`.`c23` AS `c23`, `episode`.`idShow` AS `idShow`, `episode`.`userrating` AS `userrating`, `episode`.`idSeason` AS `idSeason`, `files`.`strFilename` AS `strFileName`, `path`.`strPath` AS `strPath`, `files`.`playCount` AS `playCount`, `files`.`lastPlayed` AS `lastPlayed`, `files`.`dateAdded` AS `dateAdded`, `tvshow`.`c00` AS `strTitle`, `tvshow`.`c08` AS `genre`, `tvshow`.`c14` AS `studio`, `tvshow`.`c05` AS `premiered`, `tvshow`.`c13` AS `mpaa`, `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`, `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds` FROM (((((`Kodi_Test_Mace_Video_99`.`episode` JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `episode`.`idFile`))) JOIN `Kodi_Test_Mace_Video_99`.`tvshow` ON((`tvshow`.`idShow` = `episode`.`idShow`))) JOIN `Kodi_Test_Mace_Video_99`.`seasons` ON((`seasons`.`idSeason` = `episode`.`idSeason`))) JOIN `Kodi_Test_Mace_Video_99`.`path` ON((`files`.`idPath` = `path`.`idPath`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`bookmark` ON(((`bookmark`.`idFile` = `episode`.`idFile`) AND (`bookmark`.`type` = 1))));
CREATE VIEW `Kodi_Test_Mace_Video_99`.`movie_view` AS SELECT `movie`.`idMovie` AS `idMovie`, `movie`.`idFile` AS `idFile`, `movie`.`c00` AS `c00`, `movie`.`c01` AS `c01`, `movie`.`c02` AS `c02`, `movie`.`c03` AS `c03`, `movie`.`c04` AS `c04`, `movie`.`c05` AS `c05`, `movie`.`c06` AS `c06`, `movie`.`c07` AS `c07`, `movie`.`c08` AS `c08`, `movie`.`c09` AS `c09`, `movie`.`c10` AS `c10`, `movie`.`c11` AS `c11`, `movie`.`c12` AS `c12`, `movie`.`c13` AS `c13`, `movie`.`c14` AS `c14`, `movie`.`c15` AS `c15`, `movie`.`c16` AS `c16`, `movie`.`c17` AS `c17`, `movie`.`c18` AS `c18`, `movie`.`c19` AS `c19`, `movie`.`c20` AS `c20`, `movie`.`c21` AS `c21`, `movie`.`c22` AS `c22`, `movie`.`c23` AS `c23`, `movie`.`idSet` AS `idSet`, `movie`.`userrating` AS `userrating`, `sets`.`strSet` AS `strSet`, `sets`.`strOverview` AS `strSetOverview`, `files`.`strFilename` AS `strFileName`, `path`.`strPath` AS `strPath`, `files`.`playCount` AS `playCount`, `files`.`lastPlayed` AS `lastPlayed`, `files`.`dateAdded` AS `dateAdded`, `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`, `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds` FROM ((((`Kodi_Test_Mace_Video_99`.`movie` LEFT JOIN `Kodi_Test_Mace_Video_99`.`sets` ON((`sets`.`idSet` = `movie`.`idSet`))) JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `movie`.`idFile`))) JOIN `Kodi_Test_Mace_Video_99`.`path` ON((`path`.`idPath` = `files`.`idPath`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`bookmark` ON(((`bookmark`.`idFile` = `movie`.`idFile`) AND (`bookmark`.`type` = 1))));
CREATE VIEW `Kodi_Test_Mace_Video_99`.`musicvideo_view` AS SELECT `musicvideo`.`idMVideo` AS `idMVideo`, `musicvideo`.`idFile` AS `idFile`, `musicvideo`.`c00` AS `c00`, `musicvideo`.`c01` AS `c01`, `musicvideo`.`c02` AS `c02`, `musicvideo`.`c03` AS `c03`, `musicvideo`.`c04` AS `c04`, `musicvideo`.`c05` AS `c05`, `musicvideo`.`c06` AS `c06`, `musicvideo`.`c07` AS `c07`, `musicvideo`.`c08` AS `c08`, `musicvideo`.`c09` AS `c09`, `musicvideo`.`c10` AS `c10`, `musicvideo`.`c11` AS `c11`, `musicvideo`.`c12` AS `c12`, `musicvideo`.`c13` AS `c13`, `musicvideo`.`c14` AS `c14`, `musicvideo`.`c15` AS `c15`, `musicvideo`.`c16` AS `c16`, `musicvideo`.`c17` AS `c17`, `musicvideo`.`c18` AS `c18`, `musicvideo`.`c19` AS `c19`, `musicvideo`.`c20` AS `c20`, `musicvideo`.`c21` AS `c21`, `musicvideo`.`c22` AS `c22`, `musicvideo`.`c23` AS `c23`, `musicvideo`.`userrating` AS `userrating`, `files`.`strFilename` AS `strFileName`, `path`.`strPath` AS `strPath`, `files`.`playCount` AS `playCount`, `files`.`lastPlayed` AS `lastPlayed`, `files`.`dateAdded` AS `dateAdded`, `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`, `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds` FROM (((`Kodi_Test_Mace_Video_99`.`musicvideo` JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `musicvideo`.`idFile`))) JOIN `Kodi_Test_Mace_Video_99`.`path` ON((`path`.`idPath` = `files`.`idPath`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`bookmark` ON(((`bookmark`.`idFile` = `musicvideo`.`idFile`) AND (`bookmark`.`type` = 1))));
CREATE VIEW `Kodi_Test_Mace_Video_99`.`tvshowcounts` AS SELECT `tvshow`.`idShow` AS `idShow`, MAX(`files`.`lastPlayed`) AS `lastPlayed`, NULLIF(COUNT(`episode`.`c12`),0) AS `totalCount`, COUNT(`files`.`playCount`) AS `watchedcount`, NULLIF(COUNT(DISTINCT `episode`.`c12`),0) AS `totalSeasons`, MAX(`files`.`dateAdded`) AS `dateAdded` FROM ((`Kodi_Test_Mace_Video_99`.`tvshow` LEFT JOIN `Kodi_Test_Mace_Video_99`.`episode` ON((`episode`.`idShow` = `tvshow`.`idShow`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `episode`.`idFile`))) GROUP BY `tvshow`.`idShow`;
CREATE VIEW `Kodi_Test_Mace_Video_99`.`tvshow_view` AS SELECT `tvshow`.`idShow` AS `idShow`, `tvshow`.`c00` AS `c00`, `tvshow`.`c01` AS `c01`, `tvshow`.`c02` AS `c02`, `tvshow`.`c03` AS `c03`, `tvshow`.`c04` AS `c04`, `tvshow`.`c05` AS `c05`, `tvshow`.`c06` AS `c06`, `tvshow`.`c07` AS `c07`, `tvshow`.`c08` AS `c08`, `tvshow`.`c09` AS `c09`, `tvshow`.`c10` AS `c10`, `tvshow`.`c11` AS `c11`, `tvshow`.`c12` AS `c12`, `tvshow`.`c13` AS `c13`, `tvshow`.`c14` AS `c14`, `tvshow`.`c15` AS `c15`, `tvshow`.`c16` AS `c16`, `tvshow`.`c17` AS `c17`, `tvshow`.`c18` AS `c18`, `tvshow`.`c19` AS `c19`, `tvshow`.`c20` AS `c20`, `tvshow`.`c21` AS `c21`, `tvshow`.`c22` AS `c22`, `tvshow`.`c23` AS `c23`, `tvshow`.`userrating` AS `userrating`, `path`.`idParentPath` AS `idParentPath`, `path`.`strPath` AS `strPath`, `tvshowcounts`.`dateAdded` AS `dateAdded`, `tvshowcounts`.`lastPlayed` AS `lastPlayed`, `tvshowcounts`.`totalCount` AS `totalCount`, `tvshowcounts`.`watchedcount` AS `watchedcount`, `tvshowcounts`.`totalSeasons` AS `totalSeasons` FROM (((`Kodi_Test_Mace_Video_99`.`tvshow` LEFT JOIN `Kodi_Test_Mace_Video_99`.`tvshowlinkpath` ON((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`path` ON((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) JOIN `Kodi_Test_Mace_Video_99`.`tvshowcounts` ON((`tvshow`.`idShow` = `tvshowcounts`.`idShow`))) GROUP BY `tvshow`.`idShow`;
CREATE VIEW `Kodi_Test_Mace_Video_99`.`season_view` AS SELECT `seasons`.`idSeason` AS `idSeason`, `seasons`.`idShow` AS `idShow`, `seasons`.`season` AS `season`, `seasons`.`name` AS `name`, `tvshow_view`.`strPath` AS `strPath`, `tvshow_view`.`c00` AS `showTitle`, `tvshow_view`.`c01` AS `plot`, `tvshow_view`.`c05` AS `premiered`, `tvshow_view`.`c08` AS `genre`, `tvshow_view`.`c14` AS `studio`, `tvshow_view`.`c13` AS `mpaa`, COUNT(DISTINCT `episode_view`.`idEpisode`) AS `episodes`, COUNT(`files`.`playCount`) AS `playCount`, MIN(`episode_view`.`c05`) AS `aired` FROM (((`Kodi_Test_Mace_Video_99`.`seasons` JOIN `Kodi_Test_Mace_Video_99`.`tvshow_view` ON((`tvshow_view`.`idShow` = `seasons`.`idShow`))) JOIN `Kodi_Test_Mace_Video_99`.`episode_view` ON(((`episode_view`.`idShow` = `seasons`.`idShow`) AND (`episode_view`.`c12` = `seasons`.`season`)))) JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `episode_view`.`idFile`))) GROUP BY `seasons`.`idSeason`;
Find and Repalce Vars:- Matt [Count 259]
- Mace [Count 79]
- Kiyana
- Jaide
I use Matt as my main Database, The names above should only match themselves
Opps I left in my Test in the DB names, easy fix Find and Replace "_Test_" with "_" this wont replace anything else
RE: [MYSQL] HOW-TO: 5 User XBMC - nobody1407 - 2016-03-14
Hey guys,
Thanks for this useful thread!
But I have an error/bug:
Code: 05:24:48 17196.566406 T:1967976448 ERROR: GetTvShowsByWhere failed
05:24:48 17196.566406 T:1967976448 ERROR: GetDirectory - Error getting videodb://tvshows/titles/
05:24:48 17196.580078 T:1967976448 ERROR: CGUIMediaWindow::GetDirectory(videodb://tvshows/titles/) failed
05:24:48 17196.634766 T:1427563584 NOTICE: Thread BackgroundLoader start, auto delete: false
05:24:52 17201.093750 T:1419174976 NOTICE: Previous line repeats 1 times.
05:24:52 17201.093750 T:1419174976 ERROR: GetTvShowsByWhere failed
05:24:52 17201.095703 T:1967976448 ERROR: GetDirectory - Error getting library://video/tvshows/titles.xml/
05:24:52 17201.123047 T:1967976448 ERROR: CGUIMediaWindow::GetDirectory(library://video/tvshows/titles.xml/) failed
05:24:52 17201.179688 T:1427563584 NOTICE: Thread BackgroundLoader start, auto delete: false
RE: [MYSQL] HOW-TO: 5 User XBMC - BigMong - 2016-03-14
(2016-03-14, 06:58)nobody1407 Wrote: Hey guys,
Thanks for this useful thread!
But I have an error/bug:
Code: 05:24:48 17196.566406 T:1967976448 ERROR: GetTvShowsByWhere failed
05:24:48 17196.566406 T:1967976448 ERROR: GetDirectory - Error getting videodb://tvshows/titles/
05:24:48 17196.580078 T:1967976448 ERROR: CGUIMediaWindow::GetDirectory(videodb://tvshows/titles/) failed
05:24:48 17196.634766 T:1427563584 NOTICE: Thread BackgroundLoader start, auto delete: false
05:24:52 17201.093750 T:1419174976 NOTICE: Previous line repeats 1 times.
05:24:52 17201.093750 T:1419174976 ERROR: GetTvShowsByWhere failed
05:24:52 17201.095703 T:1967976448 ERROR: GetDirectory - Error getting library://video/tvshows/titles.xml/
05:24:52 17201.123047 T:1967976448 ERROR: CGUIMediaWindow::GetDirectory(library://video/tvshows/titles.xml/) failed
05:24:52 17201.179688 T:1427563584 NOTICE: Thread BackgroundLoader start, auto delete: false
Hey nobody1407,
What version are you using? of Kodi and the SQL on this thread?
RE: [MYSQL] HOW-TO: 5 User XBMC - nobody1407 - 2016-03-14
Thanks for your answer
I collected some informations about MySQL and Kodi
Datenbank-Server
Server: Localhost via UNIX socket
Server-Typ: MySQL
Server-Version: 5.5.44-0+deb8u1 - (Raspbian)
Protokoll-Version: 10
Benutzer: root@localhost
Server-Zeichensatz: UTF-8 Unicode (utf8)
Webserver
nginx/1.6.2
Datenbank-Client Version: libmysql - 5.5.44
PHP-Version: 5.6.17-0+deb8u1
phpMyAdmin
Versionsinformationen: 4.6.0-rc2, aktuelle stabile Version: 4.5.5.1
Kodi
OpenELEC 6.0.3 (kernel: Linux 4.1.18)
Kodi 15.2 Git:02e7013 (Compiled: Mar 1 2016)
RE: [MYSQL] HOW-TO: 5 User XBMC - nobody1407 - 2016-03-14
I got the solution in your post 104
http://forum.kodi.tv/showthread.php?tid=196821&pid=1902046#pid1902046
Thanks for your support
RE: [MYSQL] HOW-TO: 5 User XBMC - BigMong - 2016-03-14
(2016-03-14, 13:41)nobody1407 Wrote: I got the solution in your post 104
http://forum.kodi.tv/showthread.php?tid=196821&pid=1902046#pid1902046
Thanks for your support
Awesome, was thinking it looked like something I had sorted before
RE: [MYSQL] HOW-TO: 5 User XBMC - apeg - 2016-03-14
I don't know how you do it BigMong, i tried for the last few weeks and only kept corrupting my DB over and over. Just say the word, Jugs on me!
I just tried your v_99 and it worked right away, Thanks!
I notice you're using a lot more global views... is it only for userrating? is that a new feature of Jarvis? each user can apply their own rating?
Cheers,
RE: [MYSQL] HOW-TO: 5 User XBMC - BigMong - 2016-03-14
(2016-03-14, 21:47)apeg Wrote: I don't know how you do it BigMong, i tried for the last few weeks and only kept corrupting my DB over and over. Just say the word, Jugs on me!
I just tried your v_99 and it worked right away, Thanks!
I notice you're using a lot more global views... is it only for userrating? is that a new feature of Jarvis? each user can apply their own rating?
Cheers,
Thank You.
from what I can tell yes, I will have a look into how its used from within Kodi.
I only spent like 15 mins within Kodi testing the rest of the time I was hanging out in phpmyadmin
RE: [MYSQL] HOW-TO: 5 User XBMC - gimalugi - 2016-03-15
thks for your work......all seems to be right for me and my 4 users.
RE: [MYSQL] HOW-TO: 5 User XBMC - john_es - 2016-04-27
(2016-03-14, 06:58)BigMong Wrote: Ok here is a working setup for Database Version 99 [aka Jarvis]
Sorry for the delay.
My last post for a Database Version 93
This has only been Tested on a New Setup
I would say it will fail the update
I always start fresh with each update, My users Watch Status and Ratings are keeped in https://trakt.tv
Since the database now has user ratings I have created Global Episode,TV Show, and Movie
In my test on the laptop everything is working, I wont be upgrading my home setup yet (Waiting for something)
Please Note: If your Database login is different to KODI you must change it below
PHP Code: /*---------- --- PREP --- ----------*/ /* GLOBAL FILES */ RENAME TABLE `Kodi_Test_Matt_Video_99`.`files` TO `Kodi_Test_Matt_Video_99`.`globalfiles`; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` CHANGE playCount playCountMatt INT(11); ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` CHANGE lastPlayed lastPlayedMatt TEXT; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD playCountMace INT(11) AFTER lastPlayedMatt; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD lastPlayedMace TEXT AFTER playCountMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD playCountKiyana INT(11) AFTER lastPlayedMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD lastPlayedKiyana TEXT AFTER playCountKiyana; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD playCountJaide INT(11) AFTER lastPlayedKiyana; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalfiles` ADD lastPlayedJaide TEXT AFTER playCountJaide;
CREATE VIEW `Kodi_Test_Matt_Video_99`.`files` AS SELECT `Kodi_Test_Matt_Video_99`.`globalfiles`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`idPath` AS `idPath`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`strFilename` AS `strFilename`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`playCountMatt` AS `playCount`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`lastPlayedMatt` AS `lastPlayed`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`dateAdded` AS `dateAdded` FROM `Kodi_Test_Matt_Video_99`.`globalfiles`;
/* GLOBAL EPISODE */ RENAME TABLE `Kodi_Test_Matt_Video_99`.`episode` TO `Kodi_Test_Matt_Video_99`.`globalepisode`; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalepisode` CHANGE userrating userratingMatt INT(11); ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalepisode` ADD userratingMace INT(11) AFTER userratingMatt; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalepisode` ADD userratingKiyana INT(11) AFTER userratingMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalepisode` ADD userratingJaide INT(11) AFTER userratingKiyana; CREATE VIEW `Kodi_Test_Matt_Video_99`.`episode` AS SELECT `Kodi_Test_Matt_Video_99`.`globalepisode`.`idEpisode` AS `idEpisode`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idShow` AS `idShow`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`userratingMatt` AS `userrating`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idSeason` AS `idSeason` FROM `Kodi_Test_Matt_Video_99`.`globalepisode`;
/* GLOBAL TV SHOW */ RENAME TABLE `Kodi_Test_Matt_Video_99`.`tvshow` TO `Kodi_Test_Matt_Video_99`.`globaltvshow`; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globaltvshow` CHANGE userrating userratingMatt INT(11); ALTER TABLE `Kodi_Test_Matt_Video_99`.`globaltvshow` ADD userratingMace INT(11) AFTER userratingMatt; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globaltvshow` ADD userratingKiyana INT(11) AFTER userratingMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globaltvshow` ADD userratingJaide INT(11) AFTER userratingKiyana;
CREATE VIEW `Kodi_Test_Matt_Video_99`.`tvshow` AS SELECT `Kodi_Test_Matt_Video_99`.`globaltvshow`.`idShow` AS `idShow`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`userratingMatt` AS `userrating` FROM `Kodi_Test_Matt_Video_99`.`globaltvshow`;
/* GLOBAL MOVIE */ RENAME TABLE `Kodi_Test_Matt_Video_99`.`movie` TO `Kodi_Test_Matt_Video_99`.`globalmovie`; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalmovie` CHANGE userrating userratingMatt INT(11); ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalmovie` ADD userratingMace INT(11) AFTER userratingMatt; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalmovie` ADD userratingKiyana INT(11) AFTER userratingMace; ALTER TABLE `Kodi_Test_Matt_Video_99`.`globalmovie` ADD userratingJaide INT(11) AFTER userratingKiyana; CREATE VIEW `Kodi_Test_Matt_Video_99`.`movie` AS SELECT `Kodi_Test_Matt_Video_99`.`globalmovie`.`idMovie` AS `idMovie`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`idSet` AS `idSet`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`userratingMatt` AS `userrating` FROM `Kodi_Test_Matt_Video_99`.`globalmovie`;
/* TRIGGER FIX FOR MULT USERS */ DROP TRIGGER IF EXISTS `Kodi_Test_Matt_Video_99`.`delete_file`; DELIMITER $$ /* REPLACE ---> KODI <--- WITH YOUR MYSQL LOGIN UID FROM THE ADVANCEDSETTINGS.XML */ CREATE DEFINER=`KODI`@`%` TRIGGER `Kodi_Test_Matt_Video_99`.`delete_file` AFTER DELETE ON `Kodi_Test_Matt_Video_99`.`globalfiles` FOR EACH ROW BEGIN DELETE FROM `Kodi_Test_Matt_Video_99`.bookmark WHERE idfile = old.idfile; DELETE FROM `Kodi_Test_Mace_Video_99`.bookmark WHERE idfile = old.idfile; DELETE FROM `Kodi_Test_Kiyana_Video_99`.bookmark WHERE idfile = old.idfile; DELETE FROM `Kodi_Test_Jaide_Video_99`.bookmark WHERE idfile = old.idfile; DELETE FROM settings WHERE idfile = old.idfile; DELETE FROM stacktimes WHERE idfile = old.idfile; DELETE FROM streamdetails WHERE idfile = old.idfile; END$$ DELIMITER ;
Here is one user setup, just find and replace to add more.
PHP Code: /*------------- --- USER 02 --- -------------*/ CREATE DATABASE IF NOT EXISTS Kodi_Test_Mace_Video_99 DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci;
/* GLOBAL FILES LINK */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`files` AS SELECT `Kodi_Test_Matt_Video_99`.`globalfiles`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`idPath` AS `idPath`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`strFilename` AS `strFilename`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`playCountMace` AS `playCount`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`lastPlayedMace` AS `lastPlayed`, `Kodi_Test_Matt_Video_99`.`globalfiles`.`dateAdded` AS `dateAdded` FROM `Kodi_Test_Matt_Video_99`.`globalfiles`;
/* GLOBAL EPISODE LINK */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`episode` AS SELECT `Kodi_Test_Matt_Video_99`.`globalepisode`.`idEpisode` AS `idEpisode`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idShow` AS `idShow`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`userratingMace` AS `userrating`, `Kodi_Test_Matt_Video_99`.`globalepisode`.`idSeason` AS `idSeason` FROM `Kodi_Test_Matt_Video_99`.`globalepisode`;
/* GLOBAL TV SHOW LINK */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`tvshow` AS SELECT `Kodi_Test_Matt_Video_99`.`globaltvshow`.`idShow` AS `idShow`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globaltvshow`.`userratingMace` AS `userrating` FROM `Kodi_Test_Matt_Video_99`.`globaltvshow`;
/* GLOBAL MOVIE LINK */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`movie` AS SELECT `Kodi_Test_Matt_Video_99`.`globalmovie`.`idMovie` AS `idMovie`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`idFile` AS `idFile`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c00` AS `c00`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c01` AS `c01`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c02` AS `c02`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c03` AS `c03`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c04` AS `c04`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c05` AS `c05`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c06` AS `c06`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c07` AS `c07`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c08` AS `c08`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c09` AS `c09`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c10` AS `c10`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c11` AS `c11`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c12` AS `c12`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c13` AS `c13`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c14` AS `c14`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c15` AS `c15`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c16` AS `c16`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c17` AS `c17`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c18` AS `c18`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c19` AS `c19`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c20` AS `c20`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c21` AS `c21`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c22` AS `c22`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`c23` AS `c23`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`idSet` AS `idSet`, `Kodi_Test_Matt_Video_99`.`globalmovie`.`userratingMace` AS `userrating` FROM `Kodi_Test_Matt_Video_99`.`globalmovie`;
/* USER BOOKMARKS */ CREATE TABLE `Kodi_Test_Mace_Video_99`.`bookmark` ( `idBookmark` int(11) NOT NULL, `idFile` int(11) DEFAULT NULL, `timeInSeconds` double DEFAULT NULL, `totalTimeInSeconds` double DEFAULT NULL, `thumbNailImage` text, `player` text, `playerState` text, `type` int(11) DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1; ALTER TABLE `Kodi_Test_Mace_Video_99`.`bookmark` ADD PRIMARY KEY (`idBookmark`), ADD KEY `ix_bookmark` (`idFile`,`type`); ALTER TABLE `Kodi_Test_Mace_Video_99`.`bookmark` MODIFY `idBookmark` int(11) NOT NULL AUTO_INCREMENT;
/* USER VIEWS */ CREATE VIEW `Kodi_Test_Mace_Video_99`.`actor` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`actor`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`actor_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`actor_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`art` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`art`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`country` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`country`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`country_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`country_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`director_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`director_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`genre` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`genre`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`genre_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`genre_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`movielinktvshow` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`movielinktvshow`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`musicvideo` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`musicvideo`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`path` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`path`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`seasons` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`seasons`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`sets` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`sets`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`settings` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`settings`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`stacktimes` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`stacktimes`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`streamdetails` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`streamdetails`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`studio` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`studio`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`studio_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`studio_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`tag` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`tag`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`tag_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`tag_link`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`tvshowlinkpath` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`tvshowlinkpath`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`version` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`version`; CREATE VIEW `Kodi_Test_Mace_Video_99`.`writer_link` AS SELECT * FROM `Kodi_Test_Matt_Video_99`.`writer_link`;
CREATE VIEW `Kodi_Test_Mace_Video_99`.`episode_view` AS SELECT `episode`.`idEpisode` AS `idEpisode`, `episode`.`idFile` AS `idFile`, `episode`.`c00` AS `c00`, `episode`.`c01` AS `c01`, `episode`.`c02` AS `c02`, `episode`.`c03` AS `c03`, `episode`.`c04` AS `c04`, `episode`.`c05` AS `c05`, `episode`.`c06` AS `c06`, `episode`.`c07` AS `c07`, `episode`.`c08` AS `c08`, `episode`.`c09` AS `c09`, `episode`.`c10` AS `c10`, `episode`.`c11` AS `c11`, `episode`.`c12` AS `c12`, `episode`.`c13` AS `c13`, `episode`.`c14` AS `c14`, `episode`.`c15` AS `c15`, `episode`.`c16` AS `c16`, `episode`.`c17` AS `c17`, `episode`.`c18` AS `c18`, `episode`.`c19` AS `c19`, `episode`.`c20` AS `c20`, `episode`.`c21` AS `c21`, `episode`.`c22` AS `c22`, `episode`.`c23` AS `c23`, `episode`.`idShow` AS `idShow`, `episode`.`userrating` AS `userrating`, `episode`.`idSeason` AS `idSeason`, `files`.`strFilename` AS `strFileName`, `path`.`strPath` AS `strPath`, `files`.`playCount` AS `playCount`, `files`.`lastPlayed` AS `lastPlayed`, `files`.`dateAdded` AS `dateAdded`, `tvshow`.`c00` AS `strTitle`, `tvshow`.`c08` AS `genre`, `tvshow`.`c14` AS `studio`, `tvshow`.`c05` AS `premiered`, `tvshow`.`c13` AS `mpaa`, `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`, `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds` FROM (((((`Kodi_Test_Mace_Video_99`.`episode` JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `episode`.`idFile`))) JOIN `Kodi_Test_Mace_Video_99`.`tvshow` ON((`tvshow`.`idShow` = `episode`.`idShow`))) JOIN `Kodi_Test_Mace_Video_99`.`seasons` ON((`seasons`.`idSeason` = `episode`.`idSeason`))) JOIN `Kodi_Test_Mace_Video_99`.`path` ON((`files`.`idPath` = `path`.`idPath`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`bookmark` ON(((`bookmark`.`idFile` = `episode`.`idFile`) AND (`bookmark`.`type` = 1))));
CREATE VIEW `Kodi_Test_Mace_Video_99`.`movie_view` AS SELECT `movie`.`idMovie` AS `idMovie`, `movie`.`idFile` AS `idFile`, `movie`.`c00` AS `c00`, `movie`.`c01` AS `c01`, `movie`.`c02` AS `c02`, `movie`.`c03` AS `c03`, `movie`.`c04` AS `c04`, `movie`.`c05` AS `c05`, `movie`.`c06` AS `c06`, `movie`.`c07` AS `c07`, `movie`.`c08` AS `c08`, `movie`.`c09` AS `c09`, `movie`.`c10` AS `c10`, `movie`.`c11` AS `c11`, `movie`.`c12` AS `c12`, `movie`.`c13` AS `c13`, `movie`.`c14` AS `c14`, `movie`.`c15` AS `c15`, `movie`.`c16` AS `c16`, `movie`.`c17` AS `c17`, `movie`.`c18` AS `c18`, `movie`.`c19` AS `c19`, `movie`.`c20` AS `c20`, `movie`.`c21` AS `c21`, `movie`.`c22` AS `c22`, `movie`.`c23` AS `c23`, `movie`.`idSet` AS `idSet`, `movie`.`userrating` AS `userrating`, `sets`.`strSet` AS `strSet`, `sets`.`strOverview` AS `strSetOverview`, `files`.`strFilename` AS `strFileName`, `path`.`strPath` AS `strPath`, `files`.`playCount` AS `playCount`, `files`.`lastPlayed` AS `lastPlayed`, `files`.`dateAdded` AS `dateAdded`, `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`, `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds` FROM ((((`Kodi_Test_Mace_Video_99`.`movie` LEFT JOIN `Kodi_Test_Mace_Video_99`.`sets` ON((`sets`.`idSet` = `movie`.`idSet`))) JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `movie`.`idFile`))) JOIN `Kodi_Test_Mace_Video_99`.`path` ON((`path`.`idPath` = `files`.`idPath`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`bookmark` ON(((`bookmark`.`idFile` = `movie`.`idFile`) AND (`bookmark`.`type` = 1))));
CREATE VIEW `Kodi_Test_Mace_Video_99`.`musicvideo_view` AS SELECT `musicvideo`.`idMVideo` AS `idMVideo`, `musicvideo`.`idFile` AS `idFile`, `musicvideo`.`c00` AS `c00`, `musicvideo`.`c01` AS `c01`, `musicvideo`.`c02` AS `c02`, `musicvideo`.`c03` AS `c03`, `musicvideo`.`c04` AS `c04`, `musicvideo`.`c05` AS `c05`, `musicvideo`.`c06` AS `c06`, `musicvideo`.`c07` AS `c07`, `musicvideo`.`c08` AS `c08`, `musicvideo`.`c09` AS `c09`, `musicvideo`.`c10` AS `c10`, `musicvideo`.`c11` AS `c11`, `musicvideo`.`c12` AS `c12`, `musicvideo`.`c13` AS `c13`, `musicvideo`.`c14` AS `c14`, `musicvideo`.`c15` AS `c15`, `musicvideo`.`c16` AS `c16`, `musicvideo`.`c17` AS `c17`, `musicvideo`.`c18` AS `c18`, `musicvideo`.`c19` AS `c19`, `musicvideo`.`c20` AS `c20`, `musicvideo`.`c21` AS `c21`, `musicvideo`.`c22` AS `c22`, `musicvideo`.`c23` AS `c23`, `musicvideo`.`userrating` AS `userrating`, `files`.`strFilename` AS `strFileName`, `path`.`strPath` AS `strPath`, `files`.`playCount` AS `playCount`, `files`.`lastPlayed` AS `lastPlayed`, `files`.`dateAdded` AS `dateAdded`, `bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`, `bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds` FROM (((`Kodi_Test_Mace_Video_99`.`musicvideo` JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `musicvideo`.`idFile`))) JOIN `Kodi_Test_Mace_Video_99`.`path` ON((`path`.`idPath` = `files`.`idPath`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`bookmark` ON(((`bookmark`.`idFile` = `musicvideo`.`idFile`) AND (`bookmark`.`type` = 1))));
CREATE VIEW `Kodi_Test_Mace_Video_99`.`tvshowcounts` AS SELECT `tvshow`.`idShow` AS `idShow`, MAX(`files`.`lastPlayed`) AS `lastPlayed`, NULLIF(COUNT(`episode`.`c12`),0) AS `totalCount`, COUNT(`files`.`playCount`) AS `watchedcount`, NULLIF(COUNT(DISTINCT `episode`.`c12`),0) AS `totalSeasons`, MAX(`files`.`dateAdded`) AS `dateAdded` FROM ((`Kodi_Test_Mace_Video_99`.`tvshow` LEFT JOIN `Kodi_Test_Mace_Video_99`.`episode` ON((`episode`.`idShow` = `tvshow`.`idShow`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `episode`.`idFile`))) GROUP BY `tvshow`.`idShow`;
CREATE VIEW `Kodi_Test_Mace_Video_99`.`tvshow_view` AS SELECT `tvshow`.`idShow` AS `idShow`, `tvshow`.`c00` AS `c00`, `tvshow`.`c01` AS `c01`, `tvshow`.`c02` AS `c02`, `tvshow`.`c03` AS `c03`, `tvshow`.`c04` AS `c04`, `tvshow`.`c05` AS `c05`, `tvshow`.`c06` AS `c06`, `tvshow`.`c07` AS `c07`, `tvshow`.`c08` AS `c08`, `tvshow`.`c09` AS `c09`, `tvshow`.`c10` AS `c10`, `tvshow`.`c11` AS `c11`, `tvshow`.`c12` AS `c12`, `tvshow`.`c13` AS `c13`, `tvshow`.`c14` AS `c14`, `tvshow`.`c15` AS `c15`, `tvshow`.`c16` AS `c16`, `tvshow`.`c17` AS `c17`, `tvshow`.`c18` AS `c18`, `tvshow`.`c19` AS `c19`, `tvshow`.`c20` AS `c20`, `tvshow`.`c21` AS `c21`, `tvshow`.`c22` AS `c22`, `tvshow`.`c23` AS `c23`, `tvshow`.`userrating` AS `userrating`, `path`.`idParentPath` AS `idParentPath`, `path`.`strPath` AS `strPath`, `tvshowcounts`.`dateAdded` AS `dateAdded`, `tvshowcounts`.`lastPlayed` AS `lastPlayed`, `tvshowcounts`.`totalCount` AS `totalCount`, `tvshowcounts`.`watchedcount` AS `watchedcount`, `tvshowcounts`.`totalSeasons` AS `totalSeasons` FROM (((`Kodi_Test_Mace_Video_99`.`tvshow` LEFT JOIN `Kodi_Test_Mace_Video_99`.`tvshowlinkpath` ON((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) LEFT JOIN `Kodi_Test_Mace_Video_99`.`path` ON((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) JOIN `Kodi_Test_Mace_Video_99`.`tvshowcounts` ON((`tvshow`.`idShow` = `tvshowcounts`.`idShow`))) GROUP BY `tvshow`.`idShow`;
CREATE VIEW `Kodi_Test_Mace_Video_99`.`season_view` AS SELECT `seasons`.`idSeason` AS `idSeason`, `seasons`.`idShow` AS `idShow`, `seasons`.`season` AS `season`, `seasons`.`name` AS `name`, `tvshow_view`.`strPath` AS `strPath`, `tvshow_view`.`c00` AS `showTitle`, `tvshow_view`.`c01` AS `plot`, `tvshow_view`.`c05` AS `premiered`, `tvshow_view`.`c08` AS `genre`, `tvshow_view`.`c14` AS `studio`, `tvshow_view`.`c13` AS `mpaa`, COUNT(DISTINCT `episode_view`.`idEpisode`) AS `episodes`, COUNT(`files`.`playCount`) AS `playCount`, MIN(`episode_view`.`c05`) AS `aired` FROM (((`Kodi_Test_Mace_Video_99`.`seasons` JOIN `Kodi_Test_Mace_Video_99`.`tvshow_view` ON((`tvshow_view`.`idShow` = `seasons`.`idShow`))) JOIN `Kodi_Test_Mace_Video_99`.`episode_view` ON(((`episode_view`.`idShow` = `seasons`.`idShow`) AND (`episode_view`.`c12` = `seasons`.`season`)))) JOIN `Kodi_Test_Mace_Video_99`.`files` ON((`files`.`idFile` = `episode_view`.`idFile`))) GROUP BY `seasons`.`idSeason`;
Find and Repalce Vars:- Matt [Count 259]
- Mace [Count 79]
- Kiyana
- Jaide
I use Matt as my main Database, The names above should only match themselves
Opps I left in my Test in the DB names, easy fix Find and Replace "_Test_" with "_" this wont replace anything else
This seems cool, but I have a couple of questions... you say Matt is the main database... but couldn't I just use the word main and then create X number of child databases? What's the advantage?
Also, you say "This has only been Tested on a New Setup"... what do you mean by that?
|