• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8
Mysql profiles and watched status
#61
Is Bodhans way here http://blog.bohdans.com/ working for Kodi 13.2? Also, Do I have to create the profiles on each XBMC that I have running in the house for this to work? I am having trouble figuring out how the profiles will be shared on each unit?
Reply
#62
Hi guys

I need some assistance if anyone can give it.

I upgrade to kodi 14.0 and are using profiles between me and my parents that's a wifi link away. This setup has worked for us for at least two years on the previous xbmc's.

Now the main profile that's on my server to update and create the database works great, No issues all are fine. The other profiles though works fine with the movies but not the tv shows. I have checked the databases and they are the same as the older ones except the name. The movies list under movies and plays great, the tv shows menu are there but does not go into the list area to select the show you wish to watch.

Anyone with some brainwaves please.
Reply
#63
(2015-01-28, 14:39)GremlinCCS Wrote: Hi guys

I need some assistance if anyone can give it.

I upgrade to kodi 14.0 and are using profiles between me and my parents that's a wifi link away. This setup has worked for us for at least two years on the previous xbmc's.

Now the main profile that's on my server to update and create the database works great, No issues all are fine. The other profiles though works fine with the movies but not the tv shows. I have checked the databases and they are the same as the older ones except the name. The movies list under movies and plays great, the tv shows menu are there but does not go into the list area to select the show you wish to watch.

Anyone with some brainwaves please.

Hi guys,

First of all, thanks for the great work.

I have the same problem with tv shows, but in my case, I'm starting the database from zero. I used this setup in the previous version and worked perfectly.

At this point I have found out that the view "tvshowcounts" wasn't created on the second database.

http://pastebin.com/1N9PVtQ6#

Code:
CREATE ALGORITHM=UNDEFINED DEFINER=`xbmc`@`%` VIEW `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 tvshow      LEFT JOIN episode ON        episode.idShow=tvshow.idShow      LEFT JOIN files ON        files.idFile=episode.idFile     GROUP BY tvshow.idShow ;

even so, don't works

EDIT:

I think I have a solution, kodi works great, but sometimes, recently added didn't show correctly.

I've changed the name of moy database for YOUR_DATABASE.

1- At the view "tvshowview" , left one row idParentPath


Code:
CREATE VIEW `YOUR_DATABASE`.`tvshowview`
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`,
   `path`.`idParentPath` AS `idParentPath`,
   `path`.`strPath` AS `strPath`,
   `path`.`dateAdded` AS `dateAdded`,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`
FROM ((((`YOUR_DATABASE`.`tvshow` left join `YOUR_DATABASE`.`tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) left join `YOUR_DATABASE`.`path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) left join `YOUR_DATABASE`.`episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) left join `YOUR_DATABASE`.`files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;


2- Create view called "tvshowcounts"

Code:
CREATE VIEW `YOUR_DATABASE`.`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 tvshow LEFT JOIN episode ON episode.idShow=tvshow.idShow LEFT JOIN files ON files.idFile=episode.idFile GROUP BY tvshow.idShow ;

3- Create view called "seasonview"

Code:
CREATE ALGORITHM=UNDEFINED DEFINER=`xbmc`@`%` SQL SECURITY DEFINER VIEW `YOUR_DATABASE`.`seasonview`
AS select
    `YOUR_DATABASE`.`seasons`.`idSeason` AS `idSeason`,
    `YOUR_DATABASE`.`seasons`.`idShow` AS `idShow`,
    `YOUR_DATABASE`.`seasons`.`season` AS `season`,
    `tvshowview`.`strPath` AS `strPath`,
    `tvshowview`.`c00` AS `showTitle`,
    `tvshowview`.`c01` AS `plot`,
    `tvshowview`.`c05` AS `premiered`,
    `tvshowview`.`c08` AS `genre`,
    `tvshowview`.`c14` AS `strStudio`,
    `tvshowview`.`c13` AS `mpaa`,
    count(distinct `episodeview`.`idEpisode`) AS `episodes`,
    count(`files`.`playCount`) AS `playCount` from (((`YOUR_DATABASE`.`seasons` join `YOUR_DATABASE`.`tvshowview` on((`tvshowview`.`idShow` = `YOUR_DATABASE`.`seasons`.`idShow`))) join `YOUR_DATABASE`.`episodeview` on(((`episodeview`.`idShow` = `YOUR_DATABASE`.`seasons`.`idShow`) and (`episodeview`.`c12` = `YOUR_DATABASE`.`seasons`.`season`)))) join `YOUR_DATABASE`.`files` on((`files`.`idFile` = `episodeview`.`idFile`))) group by `YOUR_DATABASE`.`seasons`.`idSeason`;

I hope that is helpful
PD: Sorry for my bad english
Reply
#64
@ragux2

because of the recently added screen. You are using the wrong column as source in tvshowview. The correct one is "max(`files`.`dateAdded`)" instead of "`path`.`dateAdded`"

Finally. I got a working setup for Helix. I took Bohdans Tutorial as base, looked at the changes notch and ragux2 have done, compared them with the original kodi layout and made some small adjustments.

Code:
CREATE DATABASE xbmc_User1video90;
USE xbmc_User1video90;

CREATE VIEW `actorlinkepisode` AS SELECT * FROM `xbmc_video90`.`actorlinkepisode`;
CREATE VIEW `actorlinkmovie` AS SELECT * FROM `xbmc_video90`.`actorlinkmovie`;
CREATE VIEW `actorlinktvshow` AS SELECT * FROM `xbmc_video90`.`actorlinktvshow`;
CREATE VIEW `actors` AS SELECT * FROM `xbmc_video90`.`actors`;
CREATE VIEW `art` AS SELECT * FROM `xbmc_video90`.`art`;
CREATE VIEW `artistlinkmusicvideo` AS SELECT * FROM `xbmc_video90`.`artistlinkmusicvideo`;
CREATE VIEW `country` AS SELECT * FROM `xbmc_video90`.`country`;
CREATE VIEW `countrylinkmovie` AS SELECT * FROM `xbmc_video90`.`countrylinkmovie`;
CREATE VIEW `directorlinkepisode` AS SELECT * FROM `xbmc_video90`.`directorlinkepisode`;
CREATE VIEW `directorlinkmovie` AS SELECT * FROM `xbmc_video90`.`directorlinkmovie`;
CREATE VIEW `directorlinkmusicvideo` AS SELECT * FROM `xbmc_video90`.`directorlinkmusicvideo`;
CREATE VIEW `directorlinktvshow` AS SELECT * FROM `xbmc_video90`.`directorlinktvshow`;
CREATE VIEW `episode` AS SELECT * FROM `xbmc_video90`.`episode`;
CREATE VIEW `genre` AS SELECT * FROM `xbmc_video90`.`genre`;
CREATE VIEW `genrelinkmovie` AS SELECT * FROM `xbmc_video90`.`genrelinkmovie`;
CREATE VIEW `genrelinkmusicvideo` AS SELECT * FROM `xbmc_video90`.`genrelinkmusicvideo`;
CREATE VIEW `genrelinktvshow` AS SELECT * FROM `xbmc_video90`.`genrelinktvshow`;
CREATE VIEW `movie` AS SELECT * FROM `xbmc_video90`.`movie`;
CREATE VIEW `movielinktvshow` AS SELECT * FROM `xbmc_video90`.`movielinktvshow`;
CREATE VIEW `musicvideo` AS SELECT * FROM `xbmc_video90`.`musicvideo`;
CREATE VIEW `path` AS SELECT * FROM `xbmc_video90`.`path`;
CREATE VIEW `seasons` AS SELECT * FROM `xbmc_video90`.`seasons`;
CREATE VIEW `settings` AS SELECT * FROM `xbmc_video90`.`settings`;
CREATE VIEW `sets` AS SELECT * FROM `xbmc_video90`.`sets`;
CREATE VIEW `stacktimes` AS SELECT * FROM `xbmc_video90`.`stacktimes`;
CREATE VIEW `streamdetails` AS SELECT * FROM `xbmc_video90`.`streamdetails`;
CREATE VIEW `studio` AS SELECT * FROM `xbmc_video90`.`studio`;
CREATE VIEW `studiolinkmovie` AS SELECT * FROM `xbmc_video90`.`studiolinkmovie`;
CREATE VIEW `studiolinkmusicvideo` AS SELECT * FROM `xbmc_video90`.`studiolinkmusicvideo`;
CREATE VIEW `studiolinktvshow` AS SELECT * FROM `xbmc_video90`.`studiolinktvshow`;
CREATE VIEW `tag` AS SELECT * FROM `xbmc_video90`.`tag`;
CREATE VIEW `taglinks` AS SELECT * FROM `xbmc_video90`.`taglinks`;
CREATE VIEW `tvshow` AS SELECT * FROM `xbmc_video90`.`tvshow`;
CREATE VIEW `tvshowlinkpath` AS SELECT * FROM `xbmc_video90`.`tvshowlinkpath`;
CREATE VIEW `version` AS SELECT * FROM `xbmc_video90`.`version`;
CREATE VIEW `writerlinkepisode` AS SELECT * FROM `xbmc_video90`.`writerlinkepisode`;
CREATE VIEW `writerlinkmovie` AS SELECT * FROM `xbmc_video90`.`writerlinkmovie`;

CREATE TABLE `bookmark` (`idBookmark` int(11) NOT NULL auto_increment,`idFile` int(11) default NULL,`timeInSeconds` double default NULL,`totalTimeInSeconds` double default NULL,`thumbNailImage` text,`player` text,`playerState` text,`type` int(11) default NULL,PRIMARY KEY  (`idBookmark`),KEY `ix_bookmark` (`idFile`,`type`)) ENGINE=MyISAM DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
CREATE TABLE `watched_history` (`idFile` int(11) NOT NULL,`playCount` int(11) DEFAULT NULL,`lastPlayed` text,PRIMARY KEY (`idFile`)) ENGINE=InnoDB DEFAULT CHARSET=utf8 SELECT `idFile` FROM `xbmc_video90`.`files`;
CREATE VIEW `files` AS SELECT `f`.`idFile` AS `idFile`,`f`.`idPath` AS `idPath`,`f`.`strFilename` AS `strFilename`,`wh`.`playCount` AS `playCount`,`wh`.`lastPlayed` AS `lastPlayed`, `f`.`dateAdded` AS `dateAdded` FROM `xbmc_video90`.`files` `f` LEFT JOIN `xbmc_User1video90`.`watched_history` `wh` ON `f`.`idFile` = `wh`.`idFile`;
CREATE VIEW `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 ((`tvshow` LEFT JOIN `episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) LEFT JOIN `files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;

CREATE ALGORITHM=UNDEFINED DEFINER=`xbmc`@`%` SQL SECURITY DEFINER VIEW `episodeview` 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`,`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`.`c14` AS `strStudio`,`tvshow`.`c05` AS `premiered`,`tvshow`.`c13` AS `mpaa`,`bookmark`.`timeInSeconds` AS `resumeTimeInSeconds`,`bookmark`.`totalTimeInSeconds` AS `totalTimeInSeconds`,`seasons`.`idSeason` AS `idSeason` FROM (((((`episode` JOIN `files` on((`files`.`idFile` = `episode`.`idFile`))) JOIN `tvshow` on((`tvshow`.`idShow` = `episode`.`idShow`))) LEFT JOIN `seasons` on(((`seasons`.`idShow` = `episode`.`idShow`) and (`seasons`.`season` = `episode`.`c12`)))) JOIN `path` on((`files`.`idPath` = `path`.`idPath`))) LEFT JOIN `bookmark` on(((`bookmark`.`idFile` = `episode`.`idFile`) and (`bookmark`.`type` = 1))));
CREATE ALGORITHM=UNDEFINED DEFINER=`xbmc`@`%` SQL SECURITY DEFINER VIEW `movieview` 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`,`sets`.`strSet` AS `strSet`,`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 ((((`movie` LEFT JOIN `sets` on((`sets`.`idSet` = `movie`.`idSet`))) JOIN `files` on((`files`.`idFile` = `movie`.`idFile`))) JOIN `path` on((`path`.`idPath` = `files`.`idPath`))) LEFT JOIN `bookmark` on(((`bookmark`.`idFile` = `movie`.`idFile`) and (`bookmark`.`type` = 1))));
CREATE ALGORITHM=UNDEFINED DEFINER=`xbmc`@`%` SQL SECURITY DEFINER VIEW `musicvideoview` 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`,`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 (((`musicvideo` JOIN `files` on((`files`.`idFile` = `musicvideo`.`idFile`))) JOIN `path` on((`path`.`idPath` = `files`.`idPath`))) LEFT JOIN `bookmark` on(((`bookmark`.`idFile` = `musicvideo`.`idFile`) and (`bookmark`.`type` = 1))));
CREATE ALGORITHM=UNDEFINED DEFINER=`xbmc`@`%` SQL SECURITY DEFINER VIEW `tvshowview` 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`,`path`.`idParentPath` AS `idParentPath`,`path`.`strPath` AS `strPath`,max(`files`.`dateAdded`) AS `dateAdded`,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` FROM ((((`tvshow` LEFT JOIN `tvshowlinkpath` on((`tvshowlinkpath`.`idShow` = `tvshow`.`idShow`))) LEFT JOIN `path` on((`path`.`idPath` = `tvshowlinkpath`.`idPath`))) LEFT JOIN `episode` on((`episode`.`idShow` = `tvshow`.`idShow`))) LEFT JOIN `files` on((`files`.`idFile` = `episode`.`idFile`))) group by `tvshow`.`idShow`;
CREATE ALGORITHM=UNDEFINED DEFINER=`xbmc`@`%` SQL SECURITY DEFINER VIEW `seasonview` AS SELECT `seasons`.`idSeason` AS `idSeason`,`seasons`.`idShow` AS `idShow`,`seasons`.`season` AS `season`,`tvshowview`.`strPath` AS `strPath`,`tvshowview`.`c00` AS `showTitle`,`tvshowview`.`c01` AS `plot`,`tvshowview`.`c05` AS `premiered`,`tvshowview`.`c08` AS `genre`,`tvshowview`.`c14` AS `strStudio`,`tvshowview`.`c13` AS `mpaa`,count(distinct `episodeview`.`idEpisode`) AS `episodes`,count(`files`.`playCount`) AS `playCount` FROM (((`seasons` JOIN `tvshowview` on((`tvshowview`.`idShow` = `seasons`.`idShow`))) JOIN `episodeview` on(((`episodeview`.`idShow` = `seasons`.`idShow`) and (`episodeview`.`c12` = `seasons`.`season`)))) JOIN `files` on((`files`.`idFile` = `episodeview`.`idFile`))) group by `seasons`.`idSeason`;


USE xbmc_video90;

CREATE TRIGGER insert_new_watched AFTER INSERT ON xbmc_video90.files
    FOR EACH ROW
        INSERT INTO xbmc_User1video90.watched_history(idFile) VALUES (NEW.idFile);

CREATE TRIGGER remove_deleted_watched AFTER DELETE ON xbmc_video90.files
    FOR EACH ROW
        DELETE FROM xbmc_User1video90.watched_history WHERE idFile=OLD.idFile LIMIT 1;

replace "xbmc_video90" with the name of your master database and "xbmc_User1video90" with the name you want for the second user database.
Reply
#65
Nice work, Walhalla. But I'm wondering, what version of MySQL/MariaDB are you using?
I don't know about other versions, but on MySQL 5.5 you can't have multiple triggers with the same action time and event for one table.

(2015-02-04, 23:10)Walhalla Wrote: Finally. I got a working setup for Helix. I took Bohdans Tutorial as base, looked at the changes notch and ragux2 have done, compared them with the original kodi layout and made some small adjustments.
Reply
#66
(2015-02-05, 18:11)rebelyell Wrote: Nice work, Walhalla. But I'm wondering, what version of MySQL/MariaDB are you using?
I don't know about other versions, but on MySQL 5.5 you can't have multiple triggers with the same action time and event for one table.

The code is not from me. Most work has been done by the people I mentioned in the post. The trigger code is from notch. I am currently only using 2 users (master and user1), but he said in his post that it works with multiple users (he mentioned the same trigger problem and corrected a other users trigger). You just have to add a second INSERT and DELETE line on the triggers and close both with a END on each.
Reply
#67
(2015-02-05, 18:24)Walhalla Wrote: The code is not from me. Most work has been done by the people I mentioned in the post. The trigger code is from notch. I am currently only using 2 users (master and user1), but he said in his post that it works with multiple users (he mentioned the same trigger problem and corrected a other users trigger) . You just have to add a second INSERT and DELETE line on the triggers and close both with a END on each.

Thanks for the heads-up! It seems to be working just fine now!
Reply
#68
This was easy and seems to have worked fine... Still testing though.

Thanks for everyone's efforts.
Reply
#69
OK, I followed the steps Walhalla gave, but it doesn't store bookmarks or watched state.

I have no idea why. Any help?

EDIT: Nevemind, I'm an idiot.
Reply
#70
(2015-04-24, 13:43)yosubis Wrote: OK, I followed the steps Walhalla gave, but it doesn't store bookmarks or watched state.

I have no idea why. Any help?

EDIT: Nevemind, I'm an idiot.


Could you explain what the issue was and does anyone have this running with a master and then 4 users. So core database and separate 4 watched state?

I currently cant get the system to update more than one database.
Reply
#71
I don't know what he forgot to do but for more than 2 users you simple have to create more databases. Just copy and paste the code from the beginning until the second part (It starts at "USE xbmc_video90;") and replace "xbmc_User1video90" with "xbmc_User2video90" and so on. The last step is to create the triggers / modify the trigger code. Refer to post #51. I think it should show you what has to be done.
Reply
#72
I am running that but i get the following error.

Quote:You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 3"

This is the code I am running
Code:
USE myvideos90;

CREATE TRIGGER insert_new_watched AFTER INSERT ON myvideos90.files
    FOR EACH ROW BEGIN
        INSERT INTO kodi_ben90.watched_history(idFile) VALUES (NEW.idFile);
        INSERT INTO kodi_dan90.watched_history(idFile) VALUES (NEW.idFile);
        INSERT INTO kodi_dem90.watched_history(idFile) VALUES (NEW.idFile);
        INSERT INTO kodi_nath90.watched_history(idFile) VALUES (NEW.idFile);
        INSERT INTO kodi_hannah90.watched_history(idFile) VALUES (NEW.idFile);
END
Reply
#73
hmm, looks good to me. The name of the master database is "myvideos90" all lowercase? The "kodi_xxx90" databases are created? What MySQL Version are you running?
Reply
#74
The databases are created and all the content.. It's just the triggers are not been created. The names I have triple checked.. All is good. I don't get why I am getting the error. I am using version 5.6 installed as part of the WAMP setup.
Reply
#75
Okay problem solved, after digging about, I needed to add delimiter.

Code is as follows when ran from the phpmyadmin page.

Code:
delimiter //
CREATE TRIGGER insert_new_watched AFTER INSERT ON myvideos90.files
    FOR EACH ROW BEGIN
        INSERT INTO kodi_ben90.watched_history(idFile) VALUES (NEW.idFile);
        INSERT INTO kodi_dan90.watched_history(idFile) VALUES (NEW.idFile);
        INSERT INTO kodi_dem90.watched_history(idFile) VALUES (NEW.idFile);
        INSERT INTO kodi_nath90.watched_history(idFile) VALUES (NEW.idFile);
        INSERT INTO kodi_hannah90.watched_history(idFile) VALUES (NEW.idFile);
     END; //
delimiter ;
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 8

Logout Mark Read Team Forum Stats Members Help
Mysql profiles and watched status1