From: <jj...@us...> - 2004-03-05 22:45:10
|
Update of /cvsroot/ngetsuite/ngetsuite/ngetsuite In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15909/ngetsuite Modified Files: articles.rb Log Message: release detection fix&enhancement Index: articles.rb =================================================================== RCS file: /cvsroot/ngetsuite/ngetsuite/ngetsuite/articles.rb,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** articles.rb 5 Mar 2004 15:28:04 -0000 1.7 --- articles.rb 5 Mar 2004 22:30:46 -0000 1.8 *************** *** 44,48 **** def Release.indexes(subject) ! if subject =~/[\[\(](\d{1,3})\/(\d{1,3})[\]\)]/ return $1.to_i, $2.to_i, $2.length elsif subject =~ /(\d{1,3}) *of *(\d{1,3})/ --- 44,50 ---- def Release.indexes(subject) ! if subject =~ /[\[\(](\d{1,3})\/(\d{1,3})[\]\)]/ ! return $1.to_i, $2.to_i, $2.length ! elsif subject =~ /[^\d](\d{1,3})\/(\d{1,3})[^\d]/ return $1.to_i, $2.to_i, $2.length elsif subject =~ /(\d{1,3}) *of *(\d{1,3})/ *************** *** 82,86 **** if rls.poster == art._from if rls._nbactual == 1 ! # create regex match = '' (0..(rls.noidxregex.length)).each { |i| --- 84,91 ---- if rls.poster == art._from if rls._nbactual == 1 ! # create regex ! if rls.noidxregex == art._subject ! rls.noidxregex = Regexp.new '^'+Regexp.escape(art._subject) ! else match = '' (0..(rls.noidxregex.length)).each { |i| *************** *** 89,96 **** } match.sub!(/\d*$/, '') ! rls.noidxregex = Regexp.new '^'+Regexp.escape(match)+'(\d+)' end if art._subject =~ rls.noidxregex ! cur = $1.to_i rls.pushart(art, cur) else --- 94,114 ---- } match.sub!(/\d*$/, '') ! tstre = '^' + Regexp.escape(match.sub(/\.[^\.]*$/, '.')) ! tstre += '(?:par2?|rar|r\d\d|p\d\d|vol\d+\+\d+\.par2|\d\d\d|part\d+\.rar|sfv|nfo)\W' ! tstre = Regexp.new(tstre, Regexp::IGNORECASE) ! if art._subject =~ tstre and rls.noidxregex =~ tstre ! rls.noidxregex = tstre ! else ! rls.noidxregex = Regexp.new '^'+Regexp.escape(match)+'(\d{1,3})[^\d]' ! end ! end end if art._subject =~ rls.noidxregex ! if $1 ! cur = $1.to_i ! else ! cur = rls._nbactual + 1 ! end ! #NgetSuite::Utils.debug "add {#{art._subject}} (#{cur})" rls.pushart(art, cur) else *************** *** 104,107 **** --- 122,126 ---- end unless @@rls[0] + #NgetSuite::Utils.debug "creat {#{art._subject}}" rls = @@rls[0] = Release.new(art._groupindex, art._artindex) cur = 1 *************** *** 119,123 **** if (rls.poster==art._from) and (rls._nbexpected==total)#and ((rls.lastnb<cur) or (rls.lastnb==1 and cur==1)) if rls._rlsmap[cur-1] == '#' ! NgetSuite::Utils.debug "#{cat}: part #{cur} already there {#{art._subject}}" end # another art for this release --- 138,142 ---- if (rls.poster==art._from) and (rls._nbexpected==total)#and ((rls.lastnb<cur) or (rls.lastnb==1 and cur==1)) if rls._rlsmap[cur-1] == '#' ! #NgetSuite::Utils.debug "#{cat}: part #{cur} already there {#{art._subject}}" end # another art for this release |