SamTV12345 / PodFetch

A sleek and efficient podcast downloader.
https://samtv12345.github.io/PodFetch
Apache License 2.0
347 stars 25 forks source link

GPodder episodes columns are not big enough for some data #204

Closed mgoral closed 1 year ago

mgoral commented 1 year ago

Describe the bug

Hi, I'm using a docker version of PodFetch, together with postgres database on Synology NAS and I'm trying to synchronize progress of AntennaPod podcasts. Synchronization fails from AntennaPod's perspective and in PodFetch logs I see the following:

podfetch_1        | Connecting to postgresql://<redacted>
podfetch_1        | thread 'actix-rt|system:0|arbiter:2' panicked at 'Unable to insert episode: DatabaseError(Unknown, "value too long for type character varying(255)")', src/gpodder/episodes/episodes.rs:90:22

I did a little wireshark investigation of communication between AntennaPod and PodFetch and at one point AntennaPod sends the following json (prettified here):

[
(...)
  {
    "podcast": "https://feeds.simplecast.com/BqbsxVfO",
    "episode": "https://dts.podtrac.com/redirect.mp3/chrt.fm/track/288D49/stitcher.simplecastaudio.com/3bb687b0-04af-4257-90f1-39eef4e631b6/episodes/a710fd8b-55c7-4229-b35e-86f6072dcf94/audio/128/default.mp3?aid=rss_feed&awCollectionId=3bb687b0-04af-4257-90f1-39eef4e631b6&awEpisodeId=a710fd8b-55c7-4229-b35e-86f6072dcf94&feed=BqbsxVfO",
    "guid": "9a72dc6f-7556-4950-ac85-2e3835b7bccd",
    "action": "play",
    "timestamp": "2023-07-08T17:23:26",
    "started": 2635,
    "position": 2635,
    "total": 2635,
    "device": "antennapod_na_moto_g_pro"
  },
(...)
]

This is episode of "99% Invisible" podcast, which has the following RSS feed: https://feeds.simplecast.com/BqbsxVfO

as you see, the "episode" field is an entry with 319 characters, and all text columns in "episodes" table are created as varchar(255).

I've never used diesel so I don't know where it should be changed. One thing which I'd like to point though is that "episode" field contains URLs and according to this stackoverflow question the maximum length of URL is de facto 2000 characters.

Reproduction

as above

System Info

as above

Used Package Manager

n/a

Validations

SamTV12345 commented 1 year ago

Could you try again with the latest image?

mgoral commented 1 year ago

It works with the latest image, thank you.

SamTV12345 commented 1 year ago

Nice. You're welcome. I updated Postgres to use the new text Attribute which offers an unlimited amount of space.