From: Johnjohn <jj...@us...> - 2004-06-25 11:10:14
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21335/ngetsuite Modified Files: articles.rb downloader.rb group.rb Log Message: minor upgrade, better nfo/release handling Index: downloader.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/downloader.rb,v retrieving revision 1.33 retrieving revision 1.34 diff -C2 -d -r1.33 -r1.34 *** downloader.rb 19 Jun 2004 13:27:49 -0000 1.33 --- downloader.rb 25 Jun 2004 11:10:04 -0000 1.34 *************** *** 93,97 **** @curfile.insert_to_db else ! ldebug 'Queue_file already in db' @curfile.update_from_db end --- 93,97 ---- @curfile.insert_to_db else ! ldebug 'Queue_file already in db', false @curfile.update_from_db end *************** *** 121,125 **** # same as below when /^couldn't get (<.*>) from anywhere$/ ! ldebug "#{yellow 'Error'}: couldn't get #{$1}" @finish_status = 'FAILED' --- 121,125 ---- # same as below when /^couldn't get (<.*>) from anywhere$/ ! ldebug "#{yellow 'Error'}: couldn't get #{$1}", false @finish_status = 'FAILED' *************** *** 133,136 **** --- 133,138 ---- when /^Connecting to (.*)$/ ldebug "Connection to #{$1}..", false + when /^fatal error.*\(bad reply 423/ + ldebug "Error 423", false when />> 200/ ldebug green('Connected'), false Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/group.rb,v retrieving revision 1.47 retrieving revision 1.48 diff -C2 -d -r1.47 -r1.48 *** group.rb 19 Jun 2004 13:27:49 -0000 1.47 --- group.rb 25 Jun 2004 11:10:05 -0000 1.48 *************** *** 277,280 **** --- 277,289 ---- `rm -rf #{tempdir}` end + + # make the nfo the release reference + sth = Db.dbh.execute('select articles.rlsartindex,articles.groupindex,nfos.artindex from nfos left join articles using (artindex,groupindex) where articles.artindex != articles.rlsartindex and articles.groupindex=?', @_groupindex) + rls, gid, nrls = nil + sth.fetch do |row| + rls, gid, nrls = *row + Db.dbh.do("update articles set rlsartindex='#{nrls}' where rlsartindex='#{rls}' and groupindex='#{gid}'") + end + sth.finish debug "#{nb_nfos} nfos indexed in #{Utils.cooltime(Time.now-t)}" Index: articles.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/articles.rb,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** articles.rb 19 Jun 2004 13:27:49 -0000 1.11 --- articles.rb 25 Jun 2004 11:10:04 -0000 1.12 *************** *** 207,228 **** def Release.list(groupid = '') ! req = 'select articles.subject,releases.rlsmap,releases.nbactual,releases.nbexpected,releases.artindex,releases.groupindex ! from releases,articles where articles.artindex = releases.artindex and articles.groupindex = releases.groupindex' if (groupid != '') groupindex = Group.getindex(groupid) ! req += " and releases.groupindex='#{groupindex}'" end req += ' order by releases.time asc' sth = Db.dbh.execute req i = 0 ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx, nfo_list = nil sth.fetch do |row| ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx = *row ! nfo_list = Db.dbh.select_one("select nfos.artindex from nfos,articles where articles.groupindex='#{grpidx}' and nfos.groupindex='#{grpidx}' and nfos.artindex=articles.artindex and articles.rlsartindex='#{rlsidx}'") ! puts "[#{Utils.blue i}] #{Utils.yellow nbact}/#{Utils.yellow nbtot} [#{Utils.green rlsmap if rlsmap}] \"#{subj}\"#{' nfo n°'+Utils.red(nfo_list[0]) if nfo_list}" i += 1 end --- 207,229 ---- def Release.list(groupid = '') ! req = 'select articles.subject, releases.rlsmap, releases.nbactual,releases.nbexpected, releases.artindex, releases.groupindex, nfos.artindex '+ ! 'from releases left join articles using (groupindex,artindex) '+ ! 'left join nfos using (groupindex,artindex)' if (groupid != '') groupindex = Group.getindex(groupid) ! req += " where releases.groupindex='#{groupindex}'" end req += ' order by releases.time asc' + Utils.debug req sth = Db.dbh.execute req i = 0 ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx, nfo = nil sth.fetch do |row| ! subj, rlsmap, nbact, nbtot, rlsidx, grpidx, nfo = *row ! puts "[#{Utils.blue i}] #{Utils.yellow nbact}/#{Utils.yellow nbtot} [#{Utils.green rlsmap if rlsmap}] \"#{subj}\"#{' nfo n°'+Utils.red(nfo) if nfo}" i += 1 end |