From 900b8d966fd3e6a6a1728b207b5f84c5027b8917 Mon Sep 17 00:00:00 2001 From: Kevin Glowacz Date: Fri, 4 Dec 2009 04:31:29 +0000 Subject: [PATCH] (trunk web) show relevant status and progress bar for when a magnetized torrent is still waiting for metadata --- web/images/progress/progress.png | Bin 274 -> 3109 bytes web/javascript/torrent.js | 71 +++++++++++++++++++------------ web/stylesheets/common.css | 14 ++++++ 3 files changed, 57 insertions(+), 28 deletions(-) diff --git a/web/images/progress/progress.png b/web/images/progress/progress.png index 393a0c3a119134bcda28f214a24f7341fca8741d..d7567d4e69ee43f125814575de54d386445b44c9 100644 GIT binary patch literal 3109 zcmV+=4BGRFP)KLZ*U+IBfRsybQWXdwQbLP>6pAqfylh#{fb6;Z(vMMVS~$e@S=j*ftg6;Uhf59&ghTmgWD0l;*T zI709Y^p6lP1rIRMx#05C~cW=H_Aw*bJ-5DT&Z2n+x)QHX^p z00esgV8|mQcmRZ%02D^@S3L16t`O%c004NIvOKvYIYoh62rY33S640`D9%Y2D-rV&neh&#Q1i z007~1e$oCcFS8neI|hJl{-P!B1ZZ9hpmq0)X0i`JwE&>$+E?>%_LC6RbVIkUx0b+_+BaR3cnT7Zv!AJxW zizFb)h!jyGOOZ85F;a?DAXP{m@;!0_IfqH8(HlgRxt7s3}k3K`kFu>>-2Q$QMFfPW!La{h336o>X zu_CMttHv6zR;&ZNiS=X8v3CR#fknUxHUxJ0uoBa_M6WNWeqIg~6QE69c9o#eyhGvpiOA@W-aonk<7r1(?fC{oI5N*U!4 zfg=2N-7=cNnjjOr{yriy6mMFgG#l znCF=fnQv8CDz++o6_Lscl}eQ+l^ZHARH>?_s@|##Rr6KLRFA1%Q+=*RRWnoLsR`7U zt5vFIcfW3@?wFpwUVxrVZ>QdQz32KIeJ}k~{cZZE^+ya? z2D1z#2HOnI7(B%_ac?{wFUQ;QQA1tBKtrWrm0_3Rgps+?Jfqb{jYbcQX~taRB;#$y zZN{S}1|}gUOHJxc?wV3fxuz+mJ4`!F$IZ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C-u%2h$&R z9cLXcYC@Xwnns&bn)_Q~Te?roKGD|d-g^8;+aC{{G(1^(O7m37Y1-+6)01cN&y1aw zoqc{T`P^XJqPBbIW6s}d4{z_f5Om?vMgNQEJG?v2T=KYd^0M3I6IZxbny)%vZR&LD zJpPl@Psh8QyPB@KTx+@RdcC!KX7}kEo;S|j^u2lU7XQ}Oo;f|;z4Ll+_r>@1-xl3| zawq-H%e&ckC+@AhPrP6BKT#_XdT7&;F71j}Joy zkC~6lh7E@6o;W@^IpRNZ{ptLtL(gQ-CY~4mqW;US7Zxvm_|@yz&e53Bp_lTPlfP|z zrTyx_>lv@x#=^!PzR7qqF<$gm`|ZJZ+;<)Cqu&ot2z=0000WV@Og>004R=004l4008;_004mL004C`008P>0026e000+nl3&F} z0003{NklxhC&nOz0VgnO;g6UJakWm){SjTvecHme2$hM8Y#768^d@yHFSP`y9Xcw z03=10E0`0EI1V{379g>rD>dTB9KB9K0L%zMQXmkJSaAj%a+I?x0w5p|AqfH^8=lq) zM*{=6TIE6#U_K)HJ>=-{^-U}`b}vb6cv>eM_1=rD?(pZT7pF;`a#UT+IcBuG>kU8P z=xtTSQ@JN1#Sb~E-YsXjZ3eb%nXI#aoZkTeBY?zJCIJ?200000NkvXXu0mjfb~v>8 delta 259 zcmV+e0sQ`@7?J{z7k@Gc0ssI2(;jSb0000PbVXQnQ*UN;cVTj606}DLVr3vnZDD6+ zQe|Oed2z{QJOBUyv`IukRCwCNmdgzSF%U!ZCkhSF4s=5`G{J>J(#t9YPm=B4HaV=Vm&3*fIc!g7zZSky002ov JPDHLkV1g{;ZXy5x diff --git a/web/javascript/torrent.js b/web/javascript/torrent.js index 5927e108d..97b06c4f1 100644 --- a/web/javascript/torrent.js +++ b/web/javascript/torrent.js @@ -30,7 +30,7 @@ Torrent._ErrLocalError = 3; Torrent._StaticFields = [ 'addedDate', 'comment', 'creator', 'dateCreated', 'hashString', 'id', 'isPrivate', 'name', 'totalSize', 'pieceCount', 'pieceSize' ] Torrent._DynamicFields = [ 'downloadedEver', 'error', 'errorString', 'eta', - 'haveUnchecked', 'haveValid', 'leftUntilDone', 'peersConnected', + 'haveUnchecked', 'haveValid', 'leftUntilDone', 'metadataPercentComplete', 'peersConnected', 'peersGettingFromUs', 'peersSendingToUs', 'rateDownload', 'rateUpload', 'recheckProgress', 'sizeWhenDone', 'status', 'uploadedEver', 'uploadRatio', 'seedRatioLimit', 'seedRatioMode', 'downloadDir' ] @@ -185,6 +185,7 @@ Torrent.prototype = name: function() { return this._name; }, peersSendingToUs: function() { return this._peers_sending_to_us; }, peersGettingFromUs: function() { return this._peers_getting_from_us; }, + needsMetaData: function(){ return this._metadataPercentComplete < 1 }, getPercentDone: function() { if( !this._sizeWhenDone ) return 1.0; if( !this._leftUntilDone ) return 1.0; @@ -311,26 +312,27 @@ Torrent.prototype = * Refresh display */ refreshData: function(data) { - this._completed = data.haveUnchecked + data.haveValid; - this._verified = data.haveValid; - this._leftUntilDone = data.leftUntilDone; - this._download_total = data.downloadedEver; - this._upload_total = data.uploadedEver; - this._upload_ratio = data.uploadRatio; - this._seed_ratio_limit = data.seedRatioLimit; - this._seed_ratio_mode = data.seedRatioMode; - this._download_speed = data.rateDownload; - this._upload_speed = data.rateUpload; - this._peers_connected = data.peersConnected; - this._peers_getting_from_us = data.peersGettingFromUs; - this._peers_sending_to_us = data.peersSendingToUs; - this._sizeWhenDone = data.sizeWhenDone; - this._recheckProgress = data.recheckProgress; - this._error = data.error; - this._error_string = data.errorString; - this._eta = data.eta; - this._state = data.status; - this._download_dir = data.downloadDir; + this._completed = data.haveUnchecked + data.haveValid; + this._verified = data.haveValid; + this._leftUntilDone = data.leftUntilDone; + this._download_total = data.downloadedEver; + this._upload_total = data.uploadedEver; + this._upload_ratio = data.uploadRatio; + this._seed_ratio_limit = data.seedRatioLimit; + this._seed_ratio_mode = data.seedRatioMode; + this._download_speed = data.rateDownload; + this._upload_speed = data.rateUpload; + this._peers_connected = data.peersConnected; + this._peers_getting_from_us = data.peersGettingFromUs; + this._peers_sending_to_us = data.peersSendingToUs; + this._sizeWhenDone = data.sizeWhenDone; + this._recheckProgress = data.recheckProgress; + this._error = data.error; + this._error_string = data.errorString; + this._eta = data.eta; + this._state = data.status; + this._download_dir = data.downloadDir; + this._metadataPercentComplete = data.metadataPercentComplete; if (data.fileStats) this.refreshFileModel( data ); @@ -424,8 +426,25 @@ Torrent.prototype = // when a verifying/downloading torrent gets state seeding if( this._state === Torrent._StatusSeeding ) notDone = false ; - - if( notDone ) + + if( this.needsMetaData() ){ + var metaPercentComplete = this._metadataPercentComplete * 1000 / 100 + progress_details = "Magnetized transfer - retrieving metadata ("; + progress_details += metaPercentComplete; + progress_details += "%)"; + + var empty = ""; + if(metaPercentComplete == 0) + empty = "empty"; + + root._progress_complete_container.style.width = metaPercentComplete + "%"; + root._progress_complete_container.className = 'torrent_progress_bar in_progress meta ' + empty; + root._progress_incomplete_container.style.width = 100 - metaPercentComplete + "%" + root._progress_incomplete_container.className = 'torrent_progress_bar incomplete meta'; + root._progress_incomplete_container.style.display = 'block'; + + } + else if( notDone ) { var eta = ''; @@ -462,11 +481,7 @@ Torrent.prototype = // Update the 'incomplete' bar e = root._progress_incomplete_container; - if( e.className.indexOf( 'incomplete' ) === -1 ) - e.className = 'torrent_progress_bar in_progress'; - // Clear the 'seeding' tag - if( e.className.indexOf( 'seeding' ) != -1 ) - e.className = 'torrent_progress_bar incomplete'; + e.className = 'torrent_progress_bar incomplete' e.style.width = (MaxBarWidth - css_completed_width) + '%'; e.style.display = 'block'; } diff --git a/web/stylesheets/common.css b/web/stylesheets/common.css index e62ddee96..976146b85 100644 --- a/web/stylesheets/common.css +++ b/web/stylesheets/common.css @@ -466,6 +466,20 @@ ul.torrent_list li.torrent div.torrent_progress_bar.empty { border-color: #c8cacd; } +ul.torrent_list li.torrent div.torrent_progress_bar.incomplete.meta { + background-position: left -50px; + border: 1px solid #cc6068; +} + +ul.torrent_list li.torrent div.torrent_progress_bar.in_progress.meta { + background-position: left -20px; + border-color: #c8cacd; +} + +ul.torrent_list li.torrent div.torrent_progress_bar.in_progress.meta.empty { + border: 0 none; +} + li.torrent a div { float: right; position: relative;