Empty commit

This commit is contained in:
Git 2013-11-18 08:00:46 +00:00
parent ba28852df5
commit cfe5ffcd50
2 changed files with 87 additions and 89 deletions

View File

@ -516,7 +516,7 @@ public static function update_hash($GroupID) {
Leechers, LogScore, CAST(Scene AS CHAR), CAST(HasLog AS CHAR), CAST(HasCue AS CHAR),
CAST(FreeTorrent AS CHAR), Media, Format, Encoding, Description,
RemasterYear, RemasterTitle, RemasterRecordLabel, RemasterCatalogueNumber,
REPLACE(FileList, '_', ' ') AS FileList, $VoteScore, '".db_string($ArtistName)."'
REPLACE(REPLACE(FileList, '_', ' '), '/', ' ') AS FileList, $VoteScore, '".db_string($ArtistName)."'
FROM torrents AS t
JOIN torrents_group AS g ON g.ID = t.GroupID
WHERE g.ID = $GroupID");

View File

@ -24,72 +24,70 @@ source torrents_base : connect {
sql_attr_bool = haslog
sql_attr_bool = hascue
sql_attr_uint = freetorrent
sql_query_info = select id, groupname, artistname, taglist, filelist from sphinx_hash where id = $id
}
source torrents : torrents_base {
#By inheriting from torrents_base, we keep all the connection info
sql_query_pre = set group_concat_max_len = 101400
sql_query_pre = set @starttime = now()
sql_query_pre = replace into sphinx_index_last_pos values ('torrents', unix_timestamp(@starttime))
sql_query_pre = SET group_concat_max_len = 101400
sql_query_pre = SET @starttime = NOW()
sql_query_pre = REPLACE INTO sphinx_index_last_pos VALUES ('torrents', UNIX_TIMESTAMP(@starttime))
sql_query_pre = truncate sphinx_tg
sql_query_pre = insert into sphinx_tg \
sql_query_pre = TRUNCATE sphinx_tg
sql_query_pre = INSERT INTO sphinx_tg \
(id, name, tags, year, rlabel, cnumber, catid, reltype, \
vanityhouse) \
select id, name, taglist, year, recordlabel, cataloguenumber, \
SELECT id, name, taglist, year, recordlabel, cataloguenumber, \
categoryid, releasetype, vanityhouse \
from torrents_group \
where time < @starttime
FROM torrents_group \
WHERE time < @starttime
sql_query_pre = truncate sphinx_t
sql_query_pre = insert into sphinx_t \
sql_query_pre = TRUNCATE sphinx_t
sql_query_pre = INSERT INTO sphinx_t \
(id, gid, size, snatched, seeders, leechers, time, logscore, scene, \
haslog, hascue, freetorrent, description, media, format, encoding, \
remyear, remtitle, remrlabel, remcnumber, filelist, uid, remident) \
select id, groupid, size, snatched, seeders, leechers, unix_timestamp(time), \
logscore, cast(scene as char), cast(haslog as char), \
cast(hascue as char), cast(freetorrent as char), description, \
media, format, encoding, remasteryear, remastertitle, \
remasterrecordlabel, remastercataloguenumber, filelist, userid, \
crc32(concat_ws(' ', media, remasteryear, remastertitle, \
remasterrecordlabel, remastercataloguenumber)) \
from torrents \
where time < @starttime
SELECT ID, GroupID, Size, Snatched, Seeders, Leechers, UNIX_TIMESTAMP(Time), \
LogScore, CAST(Scene AS CHAR), CAST(HasLog AS CHAR), \
CAST(HasCue AS CHAR), CAST(FreeTorrent AS CHAR), Description, \
Media, Format, Encoding, RemasterYear, RemasterTitle, \
RemasterRecordLabel, RemasterCatalogueNumber, FileList, UserID, \
CRC32(CONCAT_WS(' ', Media, RemasterYear, RemasterTitle, \
RemasterRecordLabel, RemasterCatalogueNumber)) \
FROM torrents \
WHERE Time < @starttime
sql_query_pre = truncate sphinx_a
sql_query_pre = insert into sphinx_a \
sql_query_pre = TRUNCATE sphinx_a
sql_query_pre = INSERT INTO sphinx_a \
(gid, aname) \
select groupid, group_concat(aa.name separator ' ') \
from torrents_artists ta \
join artists_alias aa using(aliasid) \
where importance in ('1','3','4','5','6') \
group by ta.groupid \
order by null
SELECT GroupID, GROUP_CONCAT(aa.Name SEPARATOR ' ') \
FROM torrents_artists AS ta \
JOIN artists_alias AS aa USING(AliasID) \
WHERE Importance IN ('1','3','4','5','6') \
GROUP BY ta.groupid \
ORDER BY NULL
sql_query = select t.id, g.id groupid, g.name groupname, tags taglist, \
year, year yearfulltext, rlabel recordlabel, \
cnumber cataloguenumber, catid categoryid, \
t.time, reltype releasetype, size>>10 size, \
snatched, seeders, leechers, logscore, scene, \
vanityhouse, haslog, hascue, freetorrent, description, \
media, format, encoding, remyear remasteryear, \
remtitle remastertitle, remrlabel remasterrecordlabel, \
remcnumber remastercataloguenumber, \
replace(filelist, '_', ' ') filelist \
from sphinx_t t \
join sphinx_tg g on t.gid=g.id
sql_query = SELECT t.id, g.id AS groupid, g.name AS groupname, \
tags AS taglist, year, year AS yearfulltext, \
rlabel AS recordlabel, cnumber AS cataloguenumber, \
catid AS categoryid, t.time, reltype AS releasetype, \
size>>10 AS size, snatched, seeders, leechers, logscore, \
scene, vanityhouse, haslog, hascue, freetorrent, description, \
media, format, encoding, remyear AS remasteryear, \
remtitle AS remastertitle, remrlabel AS remasterrecordlabel, \
remcnumber AS remastercataloguenumber, \
REPLACE(filelist, '_', ' ') AS filelist \
FROM sphinx_t AS t \
JOIN sphinx_tg AS g ON t.gid = g.id
sql_joined_field = artistname from query; \
select t.id, aname from sphinx_a join sphinx_t t using(gid) order by t.id asc;
SELECT t.id, aname FROM sphinx_a JOIN sphinx_t AS t USING(gid) ORDER BY t.id ASC;
sql_query_post_index = delete from sphinx_delta where time <= \
(select id from sphinx_index_last_pos where type='torrents')
sql_query_post_index = DELETE FROM sphinx_delta WHERE Time <= \
(SELECT id FROM sphinx_index_last_pos WHERE type = 'torrents')
}
index torrents {
@ -299,8 +297,8 @@ index torrents {
}
source delta : torrents_base {
sql_query = select *, year yearfulltext from sphinx_delta where size > 0;
sql_query_killlist = select id from sphinx_delta
sql_query = SELECT *, Year AS yearfulltext FROM sphinx_delta WHERE Size > 0;
sql_query_killlist = SELECT ID FROM sphinx_delta
}
index delta : torrents {
@ -324,46 +322,46 @@ source requests : connect {
sql_query_pre = TRUNCATE TABLE sphinx_requests
sql_query_pre = SET group_concat_max_len = 10140
sql_query_pre = SET @StartTime = NOW()
sql_query_pre = REPLACE INTO sphinx_index_last_pos VALUES ('requests', UNIX_TIMESTAMP(@StartTime))
sql_query_pre = SET @starttime = NOW()
sql_query_pre = REPLACE INTO sphinx_index_last_pos VALUES ('requests', UNIX_TIMESTAMP(@starttime))
sql_query_pre = INSERT INTO sphinx_requests ( \
ID, UserID, TimeAdded, LastVote, CategoryID, Title, \
Year, ReleaseType, CatalogueNumber, BitrateList, \
FormatList, MediaList, LogCue, FillerID, TorrentID, \
TimeFilled, Visible, Votes, Bounty ) \
Year, ReleaseType, RecordLabel, CatalogueNumber, \
BitrateList, FormatList, MediaList, LogCue, FillerID, \
TorrentID, TimeFilled, Visible, Votes, Bounty ) \
SELECT \
r.ID, r.UserID, UNIX_TIMESTAMP(TimeAdded), \
UNIX_TIMESTAMP(LastVote), CategoryID, Title, Year, \
ReleaseType, CatalogueNumber, BitrateList, FormatList, \
MediaList, LogCue, FillerID, TorrentID, \
ReleaseType, RecordLabel, CatalogueNumber, BitrateList, \
FormatList, MediaList, LogCue, FillerID, TorrentID, \
UNIX_TIMESTAMP(TimeFilled), Visible, \
COUNT(rv.RequestID), SUM(rv.Bounty) >> 10 \
FROM requests AS r \
JOIN requests_votes AS rv ON rv.RequestID=r.ID \
JOIN requests_votes AS rv ON rv.RequestID = r.ID \
GROUP BY rv.RequestID
sql_query_pre = INSERT INTO sphinx_requests ( \
ID, ArtistList ) \
SELECT \
RequestID, \
GROUP_CONCAT(aa.Name separator ' ') \
GROUP_CONCAT(aa.Name SEPARATOR ' ') \
FROM requests_artists AS ra \
JOIN artists_alias AS aa ON aa.AliasID=ra.AliasID \
JOIN requests AS r ON r.ID=ra.RequestID \
WHERE TimeAdded<=@StartTime \
JOIN artists_alias AS aa ON aa.AliasID = ra.AliasID \
JOIN requests AS r ON r.ID = ra.RequestID \
WHERE TimeAdded <= @starttime \
GROUP BY r.ID \
ON DUPLICATE KEY UPDATE ArtistList = values(ArtistList)
ON DUPLICATE KEY UPDATE ArtistList = VALUES(ArtistList)
sql_query = SELECT ID, UserID, TimeAdded, LastVote, CategoryID, Title, \
Year, ArtistList, ReleaseType, CatalogueNumber, \
Year, ArtistList, ReleaseType, RecordLabel, CatalogueNumber, \
BitrateList, FormatList, MediaList, LogCue, FillerID, \
TorrentID, TimeFilled, Visible, Votes, Bounty, \
Year AS YearFullText \
FROM sphinx_requests
sql_query_post_index = DELETE FROM sphinx_requests_delta WHERE TimeAdded <= \
(SELECT id FROM sphinx_index_last_pos WHERE type='requests')
(SELECT ID FROM sphinx_index_last_pos WHERE type = 'requests')
sql_attr_multi = uint TagID from query; \
SELECT RequestID AS ID, TagID FROM requests_tags
@ -379,8 +377,8 @@ source requests : connect {
source requests_delta : requests {
sql_query_pre = SET @nothing = 0
sql_query = SELECT ID, UserID, TimeAdded, LastVote, CategoryID, Title, \
Year, ArtistList, ReleaseType, CatalogueNumber, \
sql_query = SELECT ID, UserID, TimeAdded, LastVote, CategoryID, Title, \
Year, ArtistList, ReleaseType, RecordLabel, CatalogueNumber, \
BitrateList, FormatList, MediaList, LogCue, FillerID, \
TorrentID, TimeFilled, Visible, Votes, Bounty, \
Year AS YearFullText \
@ -391,16 +389,16 @@ source requests_delta : requests {
sql_query_killlist = SELECT ID FROM sphinx_requests_delta
sql_attr_multi = uint TagID from query; \
SELECT RequestID AS ID, TagID FROM requests_tags \
JOIN sphinx_requests_delta ON ID=RequestID
SELECT t.RequestID, t.TagID FROM requests_tags AS t\
JOIN sphinx_requests_delta AS d ON d.ID = t.RequestID
sql_attr_multi = uint Voter from query; \
SELECT RequestID AS ID, v.UserID FROM requests_votes v \
JOIN sphinx_requests_delta ON ID=RequestID
SELECT v.RequestID, v.UserID FROM requests_votes AS v \
JOIN sphinx_requests_delta AS d ON d.ID = v.RequestID
sql_attr_multi = uint Bookmarker from query; \
SELECT RequestID AS ID, b.UserID FROM bookmarks_requests b \
JOIN sphinx_requests_delta ON ID=RequestID
SELECT b.RequestID, b.UserID FROM bookmarks_requests AS b \
JOIN sphinx_requests_delta AS d ON d.ID = b.RequestID
}
index requests : torrents {
source = requests
@ -418,8 +416,8 @@ source log : connect {
sql_query_post_index = REPLACE INTO sphinx_index_last_pos VALUES ('log', $maxid)
}
source log_delta : log {
sql_query_pre = SELECT ID FROM sphinx_index_last_pos WHERE Type = 'log' INTO @LastID
sql_query = SELECT ID, UNIX_TIMESTAMP(Time) AS Time, Message FROM log WHERE ID > @LastID
sql_query_pre = SELECT ID FROM sphinx_index_last_pos WHERE type = 'log' INTO @lastid
sql_query = SELECT ID, UNIX_TIMESTAMP(Time) AS Time, Message FROM log WHERE ID > @lastid
sql_query_post_index = SET @nothing = 0
}
index log : torrents {
@ -437,25 +435,25 @@ source better_transcode : connect {
sql_attr_uint = groupid
sql_attr_uint = uploader
sql_query = select t.id, groupid, logscore, format, encoding, \
name groupname, tags taglist, year, uploader, remident \
from (select t.id, gid groupid, uid uploader, remident, \
if(media='cd',max(t.logscore),100) logscore, \
group_concat(distinct format separator ' ') \
format, \
group_concat(distinct encoding separator ' ') \
encoding \
from sphinx_t t \
where format in ('MP3', 'FLAC') \
group by gid, remident) t \
join sphinx_tg g on g.id = groupid \
where catid = 1
sql_query = SELECT t.id, groupid, logscore, format, encoding, \
name AS groupname, tags AS taglist, year, uploader, remident \
FROM (SELECT t.id, gid AS groupid, uid uploader, remident, \
IF(media='cd', MAX(t.logscore), 100) AS logscore, \
GROUP_CONCAT(DISTINCT format SEPARATOR ' ') \
AS format, \
GROUP_CONCAT(DISTINCT encoding SEPARATOR ' ') \
AS encoding \
FROM sphinx_t AS t \
WHERE format IN ('MP3', 'FLAC') \
GROUP BY gid, remident) AS t \
JOIN sphinx_tg AS g ON g.id = groupid \
WHERE catid = 1
sql_joined_field = artistname from query; \
select t.id, aname \
from sphinx_a \
join sphinx_t t using(gid) \
order by t.id asc
SELECT t.id, a.aname \
FROM sphinx_a AS a\
JOIN sphinx_t AS t USING(gid) \
ORDER BY t.id ASC
}
index better_transcode : torrents {
source = better_transcode