Radarr: Bulk folder rename does not work, requires one-by-one update

Created on 26 Oct 2017  Â·  35Comments  Â·  Source: Radarr/Radarr

I decided to have all my movie folders automatically renamed.

I read whatever instructions I could find, including:
https://github.com/Radarr/Radarr/wiki/Sorting-and-Renaming
https://github.com/Radarr/Radarr/issues/1509
https://github.com/Radarr/Radarr/issues/353

I changed the settings to enable folder rename, and static path to no.
I updated the library.
I bulk edited all movies to static path no.
I updated the library again.

I found folders that did not get renamed, e.g.
\STORAGE\Media\Movies\Movies\Aeon Flux (2005)\Æon Flux (2005).mkv

When I edit settings of a movie where the folder did not rename.
The movie is not monitored, expected.
The static path is set to no, per the bulk change.
The filename is correct, but the folder name is wrong.

If I preview rename, the rename says all work is done, while the folder is still incorrect.
If I refresh the movie, not a bulk refresh, just the one movie refresh, then suddenly the folder is renamed.

It looks like the bulk refresh does not update folders.
I expect that enabling auto rename, and setting the path to not static in bulk, and then refreshing, would rename all folders.

(I really expect the folder to be renamed, instead a new folder is created, only one movie file copied, that leaves orphan files, but this is already logged)

Radarr Version: 0.2.0.870

Screenshots before and after refresh attached.
2017-10-25 1
2017-10-25 2
2017-10-25 3

Logs:
logs.zip

confirmed enhancement ui

Most helpful comment

Hi guys,

Came across this github issue when looking to do a bulk-rename myself and ended up writing a bash script to do the job for me against the Radarr API.

For those who don't want to manually rename thousands of files (like me) here's a quick and dirty script I wrote that will do the job... Be sure to set your Radarr API Key, Host & Port before running...

#!/bin/bash
#
# Quick and dirty script to hit the Radarr API and rename any movies ...

RADARR_API_KEY="xxxxxxxx"
RADARR_HOST="127.0.0.1"
RADARR_PORT="7878"

################################################################################################

jqInstalled() {
    if ! [ -x "$(command -v jq)" ]; then
        echo 'Please install the JQ tool to: [/usr/bin/jq], before running this script. Download JQ at: https://stedolan.github.io/jq/' >&2
        exit 1
    fi
}

# Check JQ Installed first..
jqInstalled

echo "NB: Script may take some time to execute if you have thousands of movies in Radarr, please be patient ..."
TOTALITEMS=`curl -s -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-Api-Key: $RADARR_API_KEY" \
    -X GET http://$RADARR_HOST:$RADARR_PORT/api/movie`

i=0
total=`echo $TOTALITEMS | jq '. | length'`

for row in $(echo "${TOTALITEMS}" | jq -r '.[] | @base64'); do
    _jq() {
        echo ${row} | /usr/bin/base64 --decode | /usr/bin/jq -r ${1}
    }
    i=$((i + 1))

    MOVIENAME=`echo $(_jq '.title')`
    DOWNLOADED=`echo $(_jq '.downloaded')`
    ID=`echo $(_jq '.id')`
    FILENAME=`echo $(_jq '.movieFile.relativePath')`

    echo "Processing: $i/$total - '$MOVIENAME'"

    if [ "$DOWNLOADED" == "true" ]; then

        if [[ $FILENAME = *"PP-SHRUNK"* ]]; then
            echo "File has been post-processed by ffmpeg - do not rename."
        else

            RENAME_RESPONSE=`curl -s -H "Accept: application/json" \
                -H "Content-Type: application/json" \
                -H "X-Api-Key: $RADARR_API_KEY" \
                -X GET http://$RADARR_HOST:$RADARR_PORT/api/renameMovie?movieId=$ID`

            FILE_ID=`echo $RENAME_RESPONSE | jq '.[].movieFileId'`

            curl -s "http://$RADARR_HOST:$RADARR_PORT/api/command" \
                -H "Accept: application/json" \
                -H "Content-Type: application/json" \
                -H "X-Api-Key: $RADARR_API_KEY" \
                --data-binary "{\"name\":\"renameMovieFiles\",\"movieId\":$ID,\"files\":[$FILE_ID]}" >> /dev/null

        fi
    fi
done

Hope this helps some one :)
@hellfirehd, @ptr727

api-rename-radarr

All 35 comments

So, like #2170 and #2207 perhaps?

No, I think this is different, I am not changing the base path, and the path as reported is fine, it just does not rename until I do a refresh in the movie.

Definitely seems to be a bug in the rename, regardless of function.

same as mine #2199

I am having a similar problem, except when new movie folders get created, the files are not always copied over.

Hi, is there any update on this bug, i am running also into this same problem.

You can rename them for now by enabling Automatically Rename Folders and running an Update Movies Task.

This issue has been automatically marked as stale because it has not had recent activity. Please verify that this is still an issue with the latest version of Radarr and report back. Otherwise this issue will be closed.

Would not consider this stale, as this would be nice. I tried the update trick, first there isn't an 'update movies' task there is a 'refresh movie' and it does not do the rename when you run.

To rename to make them all the same, remove spaces, etc, you have to visit each movie individually and click the organize button and accept a rename. You can't navigate anywhere but 'back' and it is a lot of clicks and backs and forwards for us anal retentive types.

This has been bugging me too... I've been migrating from some old crappy windows organizer that made horrible names and paths. I was really hoping Radarr would solve this for me once and for all.

Hi guys,

Came across this github issue when looking to do a bulk-rename myself and ended up writing a bash script to do the job for me against the Radarr API.

For those who don't want to manually rename thousands of files (like me) here's a quick and dirty script I wrote that will do the job... Be sure to set your Radarr API Key, Host & Port before running...

#!/bin/bash
#
# Quick and dirty script to hit the Radarr API and rename any movies ...

RADARR_API_KEY="xxxxxxxx"
RADARR_HOST="127.0.0.1"
RADARR_PORT="7878"

################################################################################################

jqInstalled() {
    if ! [ -x "$(command -v jq)" ]; then
        echo 'Please install the JQ tool to: [/usr/bin/jq], before running this script. Download JQ at: https://stedolan.github.io/jq/' >&2
        exit 1
    fi
}

# Check JQ Installed first..
jqInstalled

echo "NB: Script may take some time to execute if you have thousands of movies in Radarr, please be patient ..."
TOTALITEMS=`curl -s -H "Accept: application/json" \
    -H "Content-Type: application/json" \
    -H "X-Api-Key: $RADARR_API_KEY" \
    -X GET http://$RADARR_HOST:$RADARR_PORT/api/movie`

i=0
total=`echo $TOTALITEMS | jq '. | length'`

for row in $(echo "${TOTALITEMS}" | jq -r '.[] | @base64'); do
    _jq() {
        echo ${row} | /usr/bin/base64 --decode | /usr/bin/jq -r ${1}
    }
    i=$((i + 1))

    MOVIENAME=`echo $(_jq '.title')`
    DOWNLOADED=`echo $(_jq '.downloaded')`
    ID=`echo $(_jq '.id')`
    FILENAME=`echo $(_jq '.movieFile.relativePath')`

    echo "Processing: $i/$total - '$MOVIENAME'"

    if [ "$DOWNLOADED" == "true" ]; then

        if [[ $FILENAME = *"PP-SHRUNK"* ]]; then
            echo "File has been post-processed by ffmpeg - do not rename."
        else

            RENAME_RESPONSE=`curl -s -H "Accept: application/json" \
                -H "Content-Type: application/json" \
                -H "X-Api-Key: $RADARR_API_KEY" \
                -X GET http://$RADARR_HOST:$RADARR_PORT/api/renameMovie?movieId=$ID`

            FILE_ID=`echo $RENAME_RESPONSE | jq '.[].movieFileId'`

            curl -s "http://$RADARR_HOST:$RADARR_PORT/api/command" \
                -H "Accept: application/json" \
                -H "Content-Type: application/json" \
                -H "X-Api-Key: $RADARR_API_KEY" \
                --data-binary "{\"name\":\"renameMovieFiles\",\"movieId\":$ID,\"files\":[$FILE_ID]}" >> /dev/null

        fi
    fi
done

Hope this helps some one :)
@hellfirehd, @ptr727

api-rename-radarr

This issue has been automatically marked as stale because it has not had recent activity. Please verify that this is still an issue with the latest version of Radarr and report back. Otherwise this issue will be closed.

I believe this is still an issue with the latest version of Radarr. It should not be marked as stale.

Latest version of radarr and still not working as it should.

I can confirm that this issue still exists in release version 0.2.0.1344.

still not working Radarr Ver. 0.2.0.1450

I have a similar use case with similar issue - re-encoding a file to 265 / hevc - the new codec is picked up on media scan, but the file name does not rename to include the new codec. Even though it has succefully renamed the original files with the correct codec on import from downloader. Seems to be tied specifically into the library scanner not triggering something.

Still an issue after 3 years, why hasn't it just been fixed?!?

Works in V3

So what?

So we close this issue and you migrate to V3

So that's now the official recommendation? Migrate to v3? I looked about 3 weeks ago and the recommendation was exactly the opposite as it was missing key features....

Yeah, I wouldn't recommend v3 for most people now. But obviously, this isn't going to get fixed in v0.2.

Yes you can wait for v3, but if this is a feature you MUST have right now as @JBFUK seems to need and is being rude asking, help test it out and provide feedback. @fryfrog you are correct, it is very unlikely much new development will be done on v2, and also unlikely new features in v3 will be back-ported into v2.

Maybe close the ability to log bug reports then? I mean it's pretty pointless.

Not sure I follow, do you consider this a bug report? Pretty clear this is an enhancement / feature request for v2. Maybe we need to make it clear that v2 is not actively worked on anymore.

Maybe you or @JBFUK could learn .NET and submit a pull request to fix it on v0.2 instead? Or switch early to v3 and report bugs on that, since that is what is actively being worked on.

@onedr0p, it is actually v0.2 btw. ;)

It's a bug report, because it's an existing feature that does not do what it's name implies. And if there's argument from the devs, the average user won't be able to know whether the dev is going to name it an obscure feature or a bug report. It does come back to it's name and it's pretty clear to me that if you have a renamer, it's meant to rename. If there's disagreement on that, it's pretty normal, there's always been a gap between how devs and customers see things.

I'm now wondering if there's a running list of what v3 (v0.2?) has and doesn't have feature parity-wise to the previous version. I'd love to help with v3, but only if it has the crucial features.

@marshalleq the v3 commit feed is here https://github.com/Radarr/Radarr/commits/aphrodite, the v3 specific issues are here https://github.com/Radarr/Radarr/issues?q=is%3Aissue+is%3Aopen+label%3Aaphrodite.

If you would like to help I would invite you to join the dedicated channel we have on discord for v3 (Aphrodite). We have around 250 users running it daily, many as there only instance. I’d venture to say the “crutial features” are there, however that’s subjective. The channel and development are very active, you are welcome to join in the fun. And as @fryfrog mentioned, if you want something fixed in v0.2, PRs are welcome.

Thanks, I'll take a look and might just do that. I am unfortunately not a developer, stronger in other areas - I'm always jealous of the devs to be honest!

Do I need an actual invite to discord? So far haven't been able to find it.

See the badges on the readme.

I've worked around it now by changing individually on each item - I don't have a very large collection.

I wasn't being rude by asking why quite a simple thing still hadn't been fixed 3 years after having been reported. It's a very simple question. Seems contributors are more eager to play with developing new features rather than the boring task of going back and fixing their (or others) previous mistakes.

This issue clearly isn't 'closed' and hasn't been 'done' so I'm not sure why it is marked as such. Until v3 is the recommended stable release this is still an active bug.

I agree wholeheartedly. However I do see the perspective of the devs, they don't see why they should work on something that in their minds is dead. Of course it's not dead and in an organisation customers whom pay would get around this problem to a point, but Open Source software is like the wild west in that regard. There are no rules other than it's free to do whatever you want, if you're willing to do it. The devs do an enormous amount of work for little thanks, and the world is all the better for it. But ultimately yes, you're right. The solution here is for someone to make an announcement to make it clear I'd say. As in 'critical bug fixes only, all future enhancements and development work has officially stopped'. That'd get people testing the new one too. :D

@marshalleq https://discord.gg/AD3UP37

No need for dev experience, we need help in other areas.. just simple things like good bug reports helps us

@JBFUK Most of Aphrodite commits are fixing v0.2 problems (over 100 v0.2 issues), so it’s not just new features. We are working to make Radarr better overall, which is why we both decided to come over from Lidarr and help when development slowed. V0.2 just works for 95 percent of people that use it, thus the critical fixes only.

It’s a slow process when you have just two main devs with other full time jobs and families working on two pieces of software the size of Radarr and Lidarr. We have much respect for our community and want to deliver a solid product, but it’s extremely frustrating to see negative feedback from users that have done nothing to help push the community forward. We welcome any and all help from wiki edits, to testing, to simply reporting bugs. You want Radarr to be better, then help make it happen.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dejected1 picture dejected1  Â·  52Comments

galli-leo picture galli-leo  Â·  49Comments

ghost picture ghost  Â·  36Comments

kmlucy picture kmlucy  Â·  220Comments

ghost picture ghost  Â·  40Comments