From: Yoann G. <jj...@us...> - 2004-10-20 14:46:49
|
Update of /cvsroot/ngetsuite/ngetsuite2/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17326/ngetsuite Modified Files: clihandler.rb group.rb nfo.rb Log Message: better nfo handling Index: nfo.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite2/ngetsuite/nfo.rb,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** nfo.rb 11 Oct 2004 22:26:25 -0000 1.1.1.1 --- nfo.rb 20 Oct 2004 14:46:38 -0000 1.2 *************** *** 12,16 **** def Nfo.searchbysubject(groupid, filter) groupindex = Group.getindex(groupid) ! req = "select n.artindex, n.groupindex, a.subject from `articles` a right join `nfos` n using (`artindex`) " req += "where a.groupindex='#{groupindex}' and a.subject RLIKE '#{filter}' " req += "order by `subject`" --- 12,16 ---- def Nfo.searchbysubject(groupid, filter) groupindex = Group.getindex(groupid) ! req = "select n.artindex, n.groupindex, a.subject, n.text from `articles` a right join `nfos` n using (`artindex`) " req += "where a.groupindex='#{groupindex}' and a.subject RLIKE '#{filter}' " req += "order by `subject`" *************** *** 18,33 **** i = 0 sth.fetch do |row| puts "NFO id: #{row[0]}" puts "Article: #{row[2]}" i += 1 end sth.finish ! return "No nfos found." if i == 0 end def Nfo.search(groupid, filter) groupindex = Group.getindex(groupid) ! req = "select n.artindex, n.groupindex, a.subject from `articles` a " req += "right join `nfos` n using (`artindex`) " req += "where a.groupindex='#{groupindex}' and n.text RLIKE '#{filter}' " --- 18,36 ---- i = 0 + nfo_text = nil sth.fetch do |row| puts "NFO id: #{row[0]}" puts "Article: #{row[2]}" + nfo_text = row[3] if i == 0 i += 1 end sth.finish ! puts nfo_text if i == 1 ! puts "No nfos found." if i == 0 end def Nfo.search(groupid, filter) groupindex = Group.getindex(groupid) ! req = "select n.artindex, n.groupindex, a.subject n.text from `articles` a " req += "right join `nfos` n using (`artindex`) " req += "where a.groupindex='#{groupindex}' and n.text RLIKE '#{filter}' " *************** *** 36,47 **** i = 0 sth.fetch do |row| puts "NFO id: #{row[0]}" puts "Article: #{row[2]}" print "\n" i += 1 end sth.finish ! return "No nfos found." if i == 0 end --- 39,53 ---- i = 0 + nfo_text = nil sth.fetch do |row| puts "NFO id: #{row[0]}" puts "Article: #{row[2]}" print "\n" + nfo_text = row[3] if i == 1 i += 1 end sth.finish ! puts nfo_text if i == 1 ! puts "No nfos found." if i == 0 end Index: group.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite2/ngetsuite/group.rb,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** group.rb 12 Oct 2004 17:01:17 -0000 1.2 --- group.rb 20 Oct 2004 14:46:38 -0000 1.3 *************** *** 254,258 **** begin # fetches the nfos, w/o decoding ! `#{"nice -n#{$config['nice_nget_update']} -- " if $config['nice_nget_update'] != 0 }#{$config['nget']} --path #{tempdir} -G #{@_fullname} -K -L 150 -r '\\.nfo|\\.txt' 2>&1` # but mark them for nget as if we didn't download them `#{"nice -n#{$config['nice_nget_update']} -- " if $config['nice_nget_update'] != 0 }#{$config['nget']} --path #{tempdir} -qq -G #{@_fullname} -U -r '\\.nfo|\\.txt' 2>&1` --- 254,258 ---- begin # fetches the nfos, w/o decoding ! `#{"nice -n#{$config['nice_nget_update']} -- " if $config['nice_nget_update'] != 0 }#{$config['nget']} --path #{tempdir} -G #{@_fullname} -K -L 150 -R 'subject \\.nfo|\\.txt == subject read\\.nfo != subject read\\.nfo.*\\.nfo == || &&' 2>&1` # but mark them for nget as if we didn't download them `#{"nice -n#{$config['nice_nget_update']} -- " if $config['nice_nget_update'] != 0 }#{$config['nget']} --path #{tempdir} -qq -G #{@_fullname} -U -r '\\.nfo|\\.txt' 2>&1` *************** *** 268,272 **** text = `#{$config['yydecode']} #{file} -o - 2>/dev/null `.chomp artindex = Db.dbh.select_one("select `artindex` from `articles` where `mid`='#{mid}'") ! if text and text.length < 15000 and text.length > 100 and artindex sth.execute(artindex[0], text) nb_nfos += 1 --- 268,272 ---- text = `#{$config['yydecode']} #{file} -o - 2>/dev/null `.chomp artindex = Db.dbh.select_one("select `artindex` from `articles` where `mid`='#{mid}'") ! if text and text.length < 25000 and text.length > 100 and artindex sth.execute(artindex[0], text) nb_nfos += 1 Index: clihandler.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite2/ngetsuite/clihandler.rb,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -d -r1.1.1.1 -r1.2 *** clihandler.rb 11 Oct 2004 22:26:26 -0000 1.1.1.1 --- clihandler.rb 20 Oct 2004 14:46:38 -0000 1.2 *************** *** 85,89 **** def test(gid) ! Group.getgroup(gid).recognizereleases end --- 85,89 ---- def test(gid) ! Group.getgroup(gid).fetchnfos end *************** *** 110,118 **** def search_nfo_by_subject(groupid, regex) ! puts Nfo.searchbysubject(groupid, regex) end def search_nfo(groupid, regex) ! puts Nfo.search(groupid, regex) end --- 110,118 ---- def search_nfo_by_subject(groupid, regex) ! Nfo.searchbysubject(groupid, regex) end def search_nfo(groupid, regex) ! Nfo.search(groupid, regex) end |