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

Backslash changes to forward slash in run external program on completion with %F #7800

Closed
nitetrak opened this issue Nov 21, 2017 · 11 comments
Closed
Assignees

Comments

@nitetrak
Copy link

nitetrak commented Nov 21, 2017

Please provide the following information

qBittorrent version and Operating System

4.0.0 on Windows 10 (v3.something worked fine before upgrading yesterday.)

If on linux, libtorrent and Qt version

NA

What is the problem

Backslash changes to forward slash in run external program on completion with %F

What is the expected behavior

Backslash instead of forward

Steps to reproduce

Run external program on torrent completion setting:
copy "%F*.mkv" "Y:" |unrar x "%F*.rar" "y:"
(note, this is not showing my backslashes in the post, but oddly they are there when I edit my post.)
copy "%F(backslash).mkv" "Y:(backslash)" |unrar x "%F(backslash).rar" "y:(backslash)"
Log shows my blackslashes were changed to forward slashes:

11/21/2017 7:35 AM - Torrent: Outlander.S03E10.Heaven.and.Earth.720p.NF.WEBRip.DD5.1.x264-NTb, running external program, command: copy "D:\DL\done\TV\Outlander.S03E10.Heaven.and.Earth.720p.NF.WEBRip.DD5.1.x264-NTb/.mkv" "Y:/" |unrar x "D:\DL\done\TV\Outlander.S03E10.Heaven.and.Earth.720p.NF.WEBRip.DD5.1.x264-NTb/.rar" "y:/"

11/20/2017 7:11 PM - Torrent: The.Gifted.S01E08.720p.HDTV.x264-AVS, running external program, command: copy "D:\DL\done\The.Gifted.S01E08.720p.HDTV.x264-AVS/.mkv" "Y:/" |unrar x "D:\DL\done\The.Gifted.S01E08.720p.HDTV.x264-AVS/.rar" "y:/"

11/20/2017 7:10 PM - Torrent: Supergirl.S03E07.720p.HDTV.x264-AVS, running external program, command: copy "D:\DL\done\TV\Supergirl.S03E07.720p.HDTV.x264-AVS/.mkv" "Y:/" |unrar x "D:\DL\done\TV\Supergirl.S03E07.720p.HDTV.x264-AVS/.rar" "y:/"

Extra info(if any)

(type here)

screenshot

@AnthonyBe
Copy link

AnthonyBe commented Nov 22, 2017

Seeing same, my WinRAR extraction command stopped working when I upgraded to 4.0 (and also 4.0.1).
I'm running Windows 10 x64 version 1709 (OS Build 16299.64) and x64 version of qBittorrent 4.0.1

The command as per qB UI:

"C:\Program Files\WinRAR\WinRAR.exe" x -r -inul -ibck "%F\*.r*" "%F\"

What results in the logfile:
(N) 2017-11-22T14:23:10 - Torrent: DCs.Legends.of.Tomorrow.S03E07.HDTV.x264-KILLERS, running external program, command: "C:/Program Files/WinRAR/WinRAR.exe" x -r -inul -ibck "D:\Downloads\DCs.Legends.of.Tomorrow.S03E07.HDTV.x264-KILLERS/*.r*" "D:\Downloads\DCs.Legends.of.Tomorrow.S03E07.HDTV.x264-KILLERS/"

Now, in qB 3.x the same show (prev ep.) looked like this:

(N) 2017-11-15T14:20:29 - Torrent: DCs.Legends.of.Tomorrow.S03E06.HDTV.x264-KILLERS, running external program, command: "C:/Program Files/WinRAR/WinRAR.exe" x -r -inul -ibck "D:\Downloads\DCs.Legends.of.Tomorrow.S03E06.HDTV.x264-KILLERS/*.r*" "D:\Downloads\DCs.Legends.of.Tomorrow.S03E06.HDTV.x264-KILLERS/"

So there is no difference in the syntax as logged (and despite the fact that qB seems to have always arbitrarily switched forwardslash and backslash) but it simply is no longer working with 4.0.x

@Chocobo1 Chocobo1 self-assigned this Nov 23, 2017
@AnthonyBe
Copy link

So, oddly, converting all uppercase characters in my command line to lowercase has resulted in the command executing (no change in logfile output either).. but the but the backslashes being switched to forwardslashes still remains.

@AnthonyBe
Copy link

After observing results for a few more days, I should qualify that the command is working about 50% of the time.

No issue recorded in the log, but then, it is only recording the steps taken, not the results. I'm at a bit of a loss to understand how the command can work 'some of the time' but given the other oddities going on here, I'm not entirely surprised.

@vit5421
Copy link

vit5421 commented Dec 24, 2017

I have the same problem with backslash to forward slash changes and forced to use the 3.16 version for now.
It will be very nice to fix it

@vit5421
Copy link

vit5421 commented Feb 17, 2018

Still not working in new 4.0.4. Please fix it

@AnthonyBe
Copy link

With 4.0.3 and 4.0.4 x64 versions I'm still finding results are erratic and unpredictable. Sometimes it works, most of the time it does not. I can't see any pattern.

@dunworth1
Copy link

this seem to be working now for me in v4.0.4

@AnthonyBe
Copy link

Chocobo1 appears to have done a PR (notes above) that will hopefully make it into the next release (4.0.5?)?

Chocobo1 added a commit that referenced this issue Mar 1, 2018
Revert back to QLineEdit for "Run external program". Closes #7800.
@Chocobo1
Copy link
Member

Chocobo1 commented Mar 1, 2018

Thanks for the report! Will be fixed in next release (v4.0.5)

@blakeusblade
Copy link

blakeusblade commented Apr 21, 2018

I'm running 4.0.4 x64

If your like me and got sick of waiting for the next release... aka v4.0.5... I've a workaround for you...

Please note it involves making edits directly to the qbittorrent configuration file as the GUI doesn't seem to be applying settings correctly. So if your not comfortable in doing so, you shall have to wait for v4.0.5. This also only applies to Windows, I don't know if this works on other OS's...

  1. Apply in the GUI the program to run. Apply and fully close/quit qbittorrent.

  2. Open C:\Users%username%\AppData\Roaming\qBittorrent\qBittorrent.ini
    %username% is windows account your running qbittorrent in.

  3. Location the item "[AutoRun]" without quotes
    Note the program= parameter...
    In the GUI it appears as something like c:\firstdirectory\seconddirectory\myscriptorprogram.exe
    In the file it appears as like this c:/firstdirectory/seconddirectory/myscriptorprogram.exe

IMPORTANT NOTE: Applying single backslashes in the config file causes qbittorrent to replace the backslash and the first character immediately afterwards with nothing (as in removes them) both in the GUI and config file. (Weird!) Simply add an additional backslashes...

  1. In my case I run a script with passed parameters so I edit the program= parameter with the following.

c:\\\\_runattorrentcomplete\\\\qbtrunattorrentcomplete.cmd \"%N" \"%L" \"%F" \"%R" \"%D" \"%C" \"%Z" \"%T" \"%I"

This makes the GUI show the correct path below and correctly runs the program with passed parameters. (In my case the script)
c:\\_runattorrentcomplete\\qbtrunattorrentcomplete.cmd "%N" "%L" "%F" "%R" "%D" "%C" "%Z" "%T" "%I"

  1. Save, quit, start qbittorrent...

While in the config file I added 4 backslashes ie \\\\ which in the GUI shows only two ie \\. I suppose only two backslashes are needed (However I've not tested it).

OTHER NOTE:
Applying the quad backslashes in the GUI didn't apply them correctly in the config file. Therefor I can only assume the the GUI isn't writting the config file correctly.

Anyways this works for me... I hope I've helped someone....

@vit5421
Copy link

vit5421 commented May 5, 2018

It works now in latest 410. Thanks

@qbittorrent qbittorrent locked and limited conversation to collaborators Feb 28, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants