{"action":"created","issue":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/4266","repository_url":"https://api.github.com/repos/qbittorrent/qBittorrent","labels_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/4266/labels{/name}","comments_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/4266/comments","events_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/4266/events","html_url":"https://github.com/qbittorrent/qBittorrent/pull/4266","id":120592338,"number":4266,"title":"Share torrents until seeding time reaches an specific amount of minutes","user":{"login":"naikel","id":7663686,"avatar_url":"https://avatars2.githubusercontent.com/u/7663686?v=3","gravatar_id":"","url":"https://api.github.com/users/naikel","html_url":"https://github.com/naikel","followers_url":"https://api.github.com/users/naikel/followers","following_url":"https://api.github.com/users/naikel/following{/other_user}","gists_url":"https://api.github.com/users/naikel/gists{/gist_id}","starred_url":"https://api.github.com/users/naikel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naikel/subscriptions","organizations_url":"https://api.github.com/users/naikel/orgs","repos_url":"https://api.github.com/users/naikel/repos","events_url":"https://api.github.com/users/naikel/events{/privacy}","received_events_url":"https://api.github.com/users/naikel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":56,"created_at":"2015-12-05T22:27:11Z","updated_at":"2017-05-15T16:28:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/pulls/4266","html_url":"https://github.com/qbittorrent/qBittorrent/pull/4266","diff_url":"https://github.com/qbittorrent/qBittorrent/pull/4266.diff","patch_url":"https://github.com/qbittorrent/qBittorrent/pull/4266.patch"},"body":"This feature appears from time to time in the Issues section as a [Wishlist].  I use it heavily.\n\nThis allows to specify seeding a torrent for up to X minutes.  You can also mix it with the max share ratio option and the torrent will stop seeding if any of both rules applies first.\n\nThis PR has several changes:\n\n1.- The method processBigRatios() was renamed to processShareLimits().  That's because the name was misleading in the first place since most people set \"1\" or \"2\" as a share ratio limit and those are not big numbers, and also because this method now also process seeding time limits.\n\n2.- Sadly I couldn't change the name of max_ratio_act for the action to apply to the torrent when it's completed in the WebUI because that would break backward compatibility.\n\n3.- The ETA method now returns qMin(ratio_eta,seeding_time_eta), that is the lowest time between reaching the ratio or reaching the time limit.\n\n4.- The option dialog was changed to this:\n\n![qBittorrent Options](http://i.imgur.com/IoiKlgj.png)\n\n5.- The WebUI was changed to this:\n\n![WebUI Options](http://i.imgur.com/pEFPhi3.png)\n\n6.- And finally the torrent share settings to:\n\n![WebUI Torrent Setting](http://i.imgur.com/u0yPXaH.png)\n\nIt works great!  I've been using it for months.\n\nHope you like it.\n"},"comment":{"url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/comments/301528553","html_url":"https://github.com/qbittorrent/qBittorrent/pull/4266#issuecomment-301528553","issue_url":"https://api.github.com/repos/qbittorrent/qBittorrent/issues/4266","id":301528553,"user":{"login":"naikel","id":7663686,"avatar_url":"https://avatars2.githubusercontent.com/u/7663686?v=3","gravatar_id":"","url":"https://api.github.com/users/naikel","html_url":"https://github.com/naikel","followers_url":"https://api.github.com/users/naikel/followers","following_url":"https://api.github.com/users/naikel/following{/other_user}","gists_url":"https://api.github.com/users/naikel/gists{/gist_id}","starred_url":"https://api.github.com/users/naikel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/naikel/subscriptions","organizations_url":"https://api.github.com/users/naikel/orgs","repos_url":"https://api.github.com/users/naikel/repos","events_url":"https://api.github.com/users/naikel/events{/privacy}","received_events_url":"https://api.github.com/users/naikel/received_events","type":"User","site_admin":false},"created_at":"2017-05-15T16:28:51Z","updated_at":"2017-05-15T16:28:51Z","body":"I'll make the changes.  \r\n\r\nBut I will also fix the same functions that have the same problem just to be consistent.\r\n\r\nWhat I mean is, if you want me to fix this:\r\n```\r\n    int globalMaxSeedingMinutes = session->globalMaxSeedingMinutes();\r\n    if (globalMaxSeedingMinutes >= 0) {\r\n        // Enable\r\n        m_ui->checkMaxSeedingMinutes->setChecked(true);\r\n        m_ui->spinMaxSeedingMinutes->setEnabled(true);\r\n        m_ui->spinMaxSeedingMinutes->setValue(globalMaxSeedingMinutes);\r\n    }\r\n```\r\nThe variable is totally useless, I know.  But why I did it? because just a couple of lines before there's this code:\r\n```\r\n    float globalMaxRatio = session->globalMaxRatio();\r\n    if (globalMaxRatio >= 0.) {\r\n        // Enable\r\n        m_ui->checkMaxRatio->setChecked(true);\r\n        m_ui->spinMaxRatio->setEnabled(true);\r\n        m_ui->comboRatioLimitAct->setEnabled(true);\r\n        m_ui->spinMaxRatio->setValue(globalMaxRatio);\r\n    }\r\n```\r\nThen I have to fix that as well, and that's not my code, but it would look totally weird that both code sections look different.\r\n\r\nThe same for the \"else\", I follow the code guidelines in new methods that I introduce, but when I'm modifying an existing one, I could be a little flexible just to follow the code guideline of that method specifically, because I think some other developer is working in fixing all the code in parallel.\r\n\r\nSo I'll take the liberty to fix the original functions that I copied to be consistent\r\n"}}
{"actor":{"display_login":"naikel"}}