Readarr / Readarr

Book Manager and Automation (Sonarr for Ebooks)
http://readarr.com
GNU General Public License v3.0
2.86k stars 156 forks source link

Deleting books will not remove them from hard drive #2224

Open Tarow opened 1 year ago

Tarow commented 1 year ago

Is there an existing issue for this?

Current Behavior

When deleting individual books from the web ui with the delete the book files option enabled, the files will be removed from the Readarr library, however they are not actually deleted on the filesystem. I tested this with multiple books from different authors (e. g. Armada from Ernest Cline) and the books were still present on the file system in every case.

When deleting an author including all its books, the author folder is actually deleted successful, so this issue only exists for individual books.

Expected Behavior

When checking the delete book files option, the files should be deleted on the file system.

Steps To Reproduce

  1. Docker environment:
    
    version: "3.7"
    services:
    readarr:
    image: lscr.io/linuxserver/readarr:develop
    container_name: readarr
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=Europe/Berlin
    volumes:
      - ./readarr-config:/config
      - /mnt/hdd1/media:/media
    restart: unless-stopped
    networks:
      - traefik-proxy
    labels:
      - "traefik.enable=true"
      - "traefik.http.routers.readarr.rule=Host(`readarr.somedomain.com`)"
      - "traefik.http.routers.readarr.entrypoints=websecure"
      - "traefik.http.services.readarr.loadbalancer.server.port=8787"

networks: traefik-proxy: external: true


2. Download or import an book for any author
3. Try to delete the book from the UI with the `delete book files` checkmark set.
4. Check if the file was actually deleted from the file system

### Environment

```markdown
- OS: Arch (6.1.12 Kernel)
- Readarr: 0.1.3.1584
- Docker Install: Yes
- Using Reverse Proxy: Yes, Traefik
- Browser: Firefox 111.0b5
- Database: Sqlite 3.40.1

What branch are you running?

Develop

Trace Logs?

Readarr.trace.txt

img1

bakerboy448 commented 1 year ago

2023-02-25 19:41:04.6|Trace|Http|Req: 3800 [DELETE] /api/v1/book/358?deleteFiles=true&addImportListExclusion=false&queryParams=%5Bobject%20Object%5D (from 10.1.1.126 Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:109.0) Gecko/20100101 Firefox/111.0)

queryParams seem rather weird here

the delete logic was never hit given the absence of

https://github.com/Readarr/Readarr/blob/02927dc37d83770599c28bb4ffc2b024297b014e/src/NzbDrone.Core/MediaFiles/MediaFileDeletionService.cs#L97

SoCraDi commented 1 year ago

I have the same issue. The only way I found that works to delete the book files is to go to the book, click Files tab, checkmark the files to delete and click delete. I am not sure if Calibre is notified via an API but the file gets deleted from the folder and disappears from Calibre too