Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show password-badge for nzbs with passwords (#274) #285

Merged
merged 6 commits into from Sep 23, 2016

Conversation

Projects
None yet
2 participants
@guaguasi
Copy link
Contributor

commented Sep 20, 2016

Label in blue denoting "encrypted" file with password displayed via title attribute on mouse over.

@hugbug hugbug changed the title Fix for Issue #274 Show password-badge for nzbs with passwords (#274) Sep 20, 2016

}
}
return isEncrypted !== false ?
' <span class="label label-info" title="'+ isEncrypted +'">ENCRYPTED</span>' : '';

This comment has been minimized.

Copy link
@hugbug

hugbug Sep 20, 2016

Member

Use Util.textToAttr(isEncrypted).
Also please use lower case for "ENCRYPTED" like for all other badges.

if (parameters[i]['Name'] === '*Unpack:Password' &&
parameters[i]['Value'])
{
isEncrypted = parameters[i]['Value'];

This comment has been minimized.

Copy link
@hugbug

hugbug Sep 20, 2016

Member

I don't understand why you assign string variable to boolean?

break;
}
}
return isEncrypted !== false ?

This comment has been minimized.

Copy link
@hugbug

hugbug Sep 20, 2016

Member

Here isEncrypted can be either boolean (false) or a string. Is it ok to compare string with false?

@@ -769,7 +770,22 @@ var DownloadsUI = (new function($)
return ' <span class="label label-priority label-info">priority: ' + priority + '</span>';
}
}


this.buildEncryptedLabel = function(parameters) {

This comment has been minimized.

Copy link
@hugbug

hugbug Sep 20, 2016

Member

please don't use dangling braces { for format consistency.

@hugbug

This comment has been minimized.

Copy link
Member

commented Sep 20, 2016

Nice done BTW 👍
I hope the comments don't sound too harsh.

@guaguasi

This comment has been minimized.

Copy link
Contributor Author

commented Sep 20, 2016

Not at all. lol.

I had originally started not having a label title but changed it midway and just never renamed the variable. You're right about the false comparison. encryptedPassword is only ever going to be undefined, a blank string, or an actual password. My original intent was to account for other falsy values but then I realized I'm dumb.

@hugbug hugbug merged commit a7525ae into nzbget:develop Sep 23, 2016

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.