Skip to content

Commit

Permalink
Version 143
Browse files Browse the repository at this point in the history
  • Loading branch information
hydrusnetwork committed Jan 7, 2015
1 parent 4927016 commit d05ba33
Show file tree
Hide file tree
Showing 20 changed files with 297 additions and 241 deletions.
21 changes: 21 additions & 0 deletions help/changelog.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,27 @@
<div class="content">
<h3>changelog</h3>
<ul>
<li><h3>version 143</h3></li>
<ul>
<li>when making a READ autocomplete tag query, instances of tags that only have a count in a single namespaced domain will no longer accumulate helper results in the non-namespaced domain i.e. no more 'blah (1)' 'title:blah (1)' dupes</li>
<li>improved the way the above results are calculated</li>
<li>pixiv artist downloading now correctly asks for numerical artist id</li>
<li>reworded some of getting started with files help page to better explain multiple selection</li>
<li>widened the splash screen a bit so db update messages have more space</li>
<li>all frames and dialogs now have an explicit minimum size that is usually far smaller than their initial size</li>
<li>the dialogs with listctrls (import files, manage custom filter actions, and so on) now start a little shorter in height</li>
<li>fixed some bad sizer flags in dialogs with listctrls</li>
<li>rebalanced content update throttling for quicker correction under heavy load</li>
<li>moved the new 5 second break in the gallery parser to a position for quicker status updates</li>
<li>the gallery parser will report total urls found when it is finished (even if that is zero) and wait a bit to let you read that</li>
<li>fixed services->news to hide if you aren't connected to any repositories</li>
<li>autocomplete boxes are now a very slight shade of blue, see if you like it</li>
<li>fixed 'launch file externally' for linux and os x</li>
<li>fixed 'launch directory externally' for linux and os x</li>
<li>fixed 'set up server for me' for linux and os x, I think</li>
<li>improved some general external-process-launching code</li>
<li>cleaned and improved some of the predicate code</li>
</ul>
<li><h3>version 142</h3></li>
<ul>
<li>added wildcards to autocomplete results and file queries</li>
Expand Down
2 changes: 1 addition & 1 deletion help/getting_started_files.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ <h3>so, what does the hydrus client do?</h3>
<ul class="bulletpoint">
<li>Click on a thumbnail; it'll show in the preview screen, bottom left.</li>
<li>Now double- or middle-click the thumbnail to go fullscreen. You can hit 'f' to switch between giving the fullscreen a frame or not. You can mouse-scroll or page up and down to browse the media, and double/middle-clicking again closes fullscreen. Hitting Enter/Return works just like double/middle click, as long as you have a thumbnail focussed.</li>
<li>Try shift- or ctrl- selecting several files, and notice how the status bar at the bottom of the screen updates with the number selected and their total size. Right clicking your selection will present another summary and many actions.</li>
<li>You can quickly select multiple files by shift- or ctrl- clicking. Notice how the status bar at the bottom of the screen updates with the number selected and their total size. Right-clicking your selection will present another summary and many actions.</li>
<li>Hit F9 to bring up a new page chooser. It won't show much right now, because you are just started. You can navigate it with the arrow keys, your numpad, or your mouse.</li>
<li>
<p>On the left of a normal search page is a text box with a large pop-up dropdown. It looks like this:</p>
Expand Down
3 changes: 1 addition & 2 deletions help/getting_started_more_files.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,7 @@ <h3>sharing files</h3>
<ul><li>8f8a3685abc19e78a92ba61d84a0482b1cfac176fd853f46d93fe437a95e40a5@hydrus.no-ip.org:45872</li></ul>
<p>Then go <i>services->review services</i> to see your client synchronise with the repository's file list.</p>
<p><img src="review_services.png" /></p>
<p>Hit F9, and you'll see a new "files->" page. It works exactly like a local search, it just uses a different file list. Files you do not have will be drawn with a dark background, those you do will be drawn as normal:</p>
<p><a href="lib_rec.png"><img src="lib_rec.png" width="683" height="384" /></a></p>
<p>Hit F9, and you'll see your new repository under "files". A repository search page works exactly like a local one, it just uses a different file list. Files you do not have will be drawn with a dark background, those you do will be drawn as normal.</p>
<p>To download a file, double- or middle-click it, or select from the right click menu.</p>
<p>If you have permission to upload files to a particular repository, that option will appear in the right-click menu for any local files. Selecting this will pend them for batch uploading; just select from the new <i>pending</i> menu to effect the upload when you are ready.</p>
<p class="right"><a href="getting_started_tags.html">Ok, I'm ready to learn about tags! ----></a></p>
Expand Down
19 changes: 10 additions & 9 deletions include/ClientConstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
CAN_HIDE_MOUSE = True

# Hue is generally 200, Sat and Lum changes based on need
COLOUR_LIGHT_SELECTED = wx.Colour( 235, 248, 255 )
COLOUR_SELECTED = wx.Colour( 217, 242, 255 )
COLOUR_SELECTED_DARK = wx.Colour( 1, 17, 26 )
COLOUR_UNSELECTED = wx.Colour( 223, 227, 230 )
Expand Down Expand Up @@ -1552,10 +1553,10 @@ def __init__( self, file_service_key = HC.COMBINED_FILE_SERVICE_KEY, tag_service

for predicate in tag_predicates:

( operator, tag ) = predicate.GetValue()
tag = predicate.GetValue()

if operator == '+': self._tags_to_include.append( tag )
elif operator == '-': self._tags_to_exclude.append( tag )
if predicate.GetInclusive(): self._tags_to_include.append( tag )
else: self._tags_to_exclude.append( tag )


namespace_predicates = [ predicate for predicate in predicates if predicate.GetPredicateType() == HC.PREDICATE_TYPE_NAMESPACE ]
Expand All @@ -1565,10 +1566,10 @@ def __init__( self, file_service_key = HC.COMBINED_FILE_SERVICE_KEY, tag_service

for predicate in namespace_predicates:

( operator, namespace ) = predicate.GetValue()
namespace = predicate.GetValue()

if operator == '+': self._namespaces_to_include.append( namespace )
elif operator == '-': self._namespaces_to_exclude.append( namespace )
if predicate.GetInclusive(): self._namespaces_to_include.append( namespace )
else: self._namespaces_to_exclude.append( namespace )


wildcard_predicates = [ predicate for predicate in predicates if predicate.GetPredicateType() == HC.PREDICATE_TYPE_WILDCARD ]
Expand All @@ -1578,10 +1579,10 @@ def __init__( self, file_service_key = HC.COMBINED_FILE_SERVICE_KEY, tag_service

for predicate in wildcard_predicates:

( operator, wildcard ) = predicate.GetValue()
wildcard = predicate.GetValue()

if operator == '+': self._wildcards_to_include.append( wildcard )
elif operator == '-': self._wildcards_to_exclude.append( wildcard )
if predicate.GetInclusive(): self._wildcards_to_include.append( wildcard )
else: self._wildcards_to_exclude.append( wildcard )



Expand Down
2 changes: 1 addition & 1 deletion include/ClientController.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,7 @@ def RestoreDatabase( self ):

call_stuff.extend( sys.argv )

subprocess.call( call_stuff, shell = True )
subprocess.Popen( call_stuff, shell = True )



Expand Down
83 changes: 56 additions & 27 deletions include/ClientDB.py
Original file line number Diff line number Diff line change
Expand Up @@ -1995,21 +1995,55 @@ def GetPossibleTagIds():
cache_results.extend( [ ( namespace_id, tag_id, current_counts[ tag_id ], pending_counts[ tag_id ] ) for tag_id in tag_ids ] )


#

current_ids_to_count = collections.Counter()
pending_ids_to_count = collections.Counter()

if collapse and not there_was_a_namespace:

added_namespaceless_current_ids_to_count = collections.Counter()
added_namespaceless_pending_ids_to_count = collections.Counter()
tag_ids_to_incidence_count = collections.Counter()


for ( namespace_id, tag_id, current_count, pending_count ) in cache_results:

current_ids_to_count[ ( namespace_id, tag_id ) ] += current_count
pending_ids_to_count[ ( namespace_id, tag_id ) ] += pending_count

if namespace_id != 1 and collapse and not there_was_a_namespace:
# prepare to add any namespaced counts to the namespaceless count

if collapse and not there_was_a_namespace and ( current_count > 0 or pending_count > 0 ):

tag_ids_to_incidence_count[ tag_id ] += 1

if namespace_id != 1:

added_namespaceless_current_ids_to_count[ tag_id ] += current_count
added_namespaceless_pending_ids_to_count[ tag_id ] += pending_count




# any instances of namespaceless counts that are just copies of a single namespaced count are not useful
# e.g. 'series:evangelion (300)' is not benefitted by adding 'evangelion (300)'
# so do not add them

if collapse and not there_was_a_namespace:

for ( tag_id, incidence ) in tag_ids_to_incidence_count.items():

current_ids_to_count[ ( 1, tag_id ) ] += current_count
pending_ids_to_count[ ( 1, tag_id ) ] += pending_count
if incidence > 1:

current_ids_to_count[ ( 1, tag_id ) ] += added_namespaceless_current_ids_to_count[ tag_id ]
pending_ids_to_count[ ( 1, tag_id ) ] += added_namespaceless_pending_ids_to_count[ tag_id ]




#

ids_to_do = set()

if include_current: ids_to_do.update( ( id for ( id, count ) in current_ids_to_count.items() if count > 0 ) )
Expand All @@ -2025,7 +2059,7 @@ def GetPossibleTagIds():

filtered_tags = tag_censorship_manager.FilterTags( tag_service_key, tags_to_do )

predicates = [ HC.Predicate( HC.PREDICATE_TYPE_TAG, ( '+', tag ), { HC.CURRENT : current_count, HC.PENDING : pending_count } ) for ( tag, current_count, pending_count ) in tag_info if tag in filtered_tags ]
predicates = [ HC.Predicate( HC.PREDICATE_TYPE_TAG, tag, counts = { HC.CURRENT : current_count, HC.PENDING : pending_count } ) for ( tag, current_count, pending_count ) in tag_info if tag in filtered_tags ]

matches = CC.AutocompleteMatchesPredicates( tag_service_key, predicates, collapse = collapse )

Expand Down Expand Up @@ -2379,7 +2413,7 @@ def _GetFileSystemPredicates( self, service_key ):

num_everything = service_info[ HC.SERVICE_INFO_NUM_FILES ]

predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_EVERYTHING, None ), { HC.CURRENT : num_everything } ) )
predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_EVERYTHING, None ), counts = { HC.CURRENT : num_everything } ) )

predicates.extend( [ HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( system_predicate_type, None ) ) for system_predicate_type in [ HC.SYSTEM_PREDICATE_TYPE_UNTAGGED, HC.SYSTEM_PREDICATE_TYPE_NUM_TAGS, HC.SYSTEM_PREDICATE_TYPE_LIMIT, HC.SYSTEM_PREDICATE_TYPE_HASH ] ] )

Expand Down Expand Up @@ -2411,18 +2445,18 @@ def _GetFileSystemPredicates( self, service_key ):
num_archive = num_local - num_inbox


predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_EVERYTHING, None ), { HC.CURRENT : num_everything } ) )
predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_EVERYTHING, None ), counts = { HC.CURRENT : num_everything } ) )

if num_inbox > 0:

predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_INBOX, None ), { HC.CURRENT : num_inbox } ) )
predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_ARCHIVE, None ), { HC.CURRENT : num_archive } ) )
predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_INBOX, None ), counts = { HC.CURRENT : num_inbox } ) )
predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_ARCHIVE, None ), counts = { HC.CURRENT : num_archive } ) )


if service_type == HC.FILE_REPOSITORY:

predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_LOCAL, None ), { HC.CURRENT : num_local } ) )
predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_NOT_LOCAL, None ), { HC.CURRENT : num_not_local } ) )
predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_LOCAL, None ), counts = { HC.CURRENT : num_local } ) )
predicates.append( HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( HC.SYSTEM_PREDICATE_TYPE_NOT_LOCAL, None ), counts = { HC.CURRENT : num_not_local } ) )


predicates.extend( [ HC.Predicate( HC.PREDICATE_TYPE_SYSTEM, ( system_predicate_type, None ) ) for system_predicate_type in [ HC.SYSTEM_PREDICATE_TYPE_UNTAGGED, HC.SYSTEM_PREDICATE_TYPE_NUM_TAGS, HC.SYSTEM_PREDICATE_TYPE_LIMIT, HC.SYSTEM_PREDICATE_TYPE_SIZE, HC.SYSTEM_PREDICATE_TYPE_AGE, HC.SYSTEM_PREDICATE_TYPE_HASH, HC.SYSTEM_PREDICATE_TYPE_WIDTH, HC.SYSTEM_PREDICATE_TYPE_HEIGHT, HC.SYSTEM_PREDICATE_TYPE_RATIO, HC.SYSTEM_PREDICATE_TYPE_DURATION, HC.SYSTEM_PREDICATE_TYPE_NUM_WORDS, HC.SYSTEM_PREDICATE_TYPE_MIME, HC.SYSTEM_PREDICATE_TYPE_RATING, HC.SYSTEM_PREDICATE_TYPE_SIMILAR_TO, HC.SYSTEM_PREDICATE_TYPE_FILE_SERVICE ] ] )
Expand Down Expand Up @@ -5292,11 +5326,6 @@ def _UpdateImageboards( self, site_edit_log ):

def _UpdateDB( self, version ):

if version == 93:

self._c.execute( 'CREATE TABLE gui_sessions ( name TEXT, info TEXT_YAML );' )


if version == 94:

# I changed a variable name in account, so old yaml dumps need to be refreshed
Expand Down Expand Up @@ -6978,7 +7007,7 @@ def DAEMONSynchroniseRepositories():

job_key.SetVariable( 'popup_message_title', 'repository synchronisation - ' + name + ' - processing' )

WEIGHT_THRESHOLD = 50
WEIGHT_THRESHOLD = 50.0

while service.CanProcessUpdate():

Expand Down Expand Up @@ -7101,24 +7130,24 @@ def DAEMONSynchroniseRepositories():

after_precise = HC.GetNowPrecise()

if after_precise - before_precise > 1.00: WEIGHT_THRESHOLD /= 1.1
elif after_precise - before_precise < 0.75: WEIGHT_THRESHOLD *= 1.1
if after_precise - before_precise > 0.75: WEIGHT_THRESHOLD /= 1.5
elif after_precise - before_precise < 0.5: WEIGHT_THRESHOLD *= 1.05

if after_precise - before_precise > 10.0 or WEIGHT_THRESHOLD < 1.0:

job_key.SetVariable( 'popup_message_text_2', 'taking a break' )

time.sleep( 10 )

WEIGHT_THRESHOLD = 1.0


total_content_weight_processed += current_weight

content_updates = []
current_weight = 0


if WEIGHT_THRESHOLD < 1:

job_key.SetVariable( 'popup_message_text_2', 'taking a break' )

time.sleep( 5 )

WEIGHT_THRESHOLD = 1



if len( content_updates ) > 0:

Expand Down
Loading

0 comments on commit d05ba33

Please sign in to comment.