Playlist

Discuss of clipshare script, custom programming, templates or anything related to this video script

Playlist

Postby dargre » Sat Oct 10, 2009 10:19 am

I noticed some bad thing about playlist table in Clipshare script.
Basically when each video watched it is stored for each user in playlist mysql table.
What is really bad: there is no limit how many records are stored in playlist table!
So in my personal database I found millions of records in this table.
Altering such table can really be bad for your mysql.
Unfortunately there's no way to limit playlist entries number when saving or reading records.
So what I did was to rebuild playlist table, added unique autoincrement field ID.
Then when storing new video or reading it, first I check if records number doesn't exceed my limit (I set 100 for each user). If so - using one mySQL query I remove oldest records above limit number.

For those that do not have so much experience with MySQL - I suggest to remove all code that stores video into playlist table. It's file "view_video.php" and code to remove is:
Code: Select all
$sql = "INSERT INTO playlist SET UID = '" .$uid. "' , VID = '" .$VID. "'";
$conn->execute($sql);


D.
Thank you,
Nuevolab Team
dargre
 
Posts: 75
Joined: Mon Sep 07, 2009 3:47 am

Re: Playlist

Postby planetqtv » Tue Dec 22, 2009 4:07 pm

Dargre,

Does this mean by removing that code, individual users will no longer generate a list of videos they have watch in their "playlist" tab?

Unfortunately I don't have enough experience go in and and rebuild the playlist table and add the unique field ID so removing that code might be my only option right now.

Thanks.

Thomas
Planet Q TV
www.planetq.tv
planetqtv
 
Posts: 1
Joined: Tue Dec 22, 2009 3:55 pm


Return to Clipshare

Who is online

Users browsing this forum: No registered users and 0 guests

cron