In [Stargate Universe][1] there is a spaceship called Destiny which travels the universe seeding planets with [stargates](https://www.gateworld.net/wiki/Stargate) and flying through stars to refuel by collecting the raw materials inside. The ship is also automated. I always thought that was a cool idea but I've been wondering if there was any previous science fiction work which this might be based on.

Note that I am not talking about using solar energy but actually flying into the star and collecting the materials inside.


  [1]: https://www.imdb.com/title/tt1286039/