Image copyright Getty Images / Jonathan Vivaas Kise

Katy Perry's new single Never Really Over sounds a lot like Love You Like That - a 2017 song by Norwegian singer Dagny.

But this isn't a lawsuit waiting to happen, Katy made sure Dagny and her team knew exactly what was going on and were recognised for their work.

"It was the start of this year that suddenly there was a call from Katy's team," Dagny tells Radio 1 Newsbeat.

"They said 'Hey, we've made a version of Love You Like That and we want to give credit where credit's due'.

Katy's Never Really Over reached number one on the UK Official Trending Chart on Tuesday.

Dagny's original version reached number 39 in Norway in 2017 and is taken from her debut album - which she'll spending the next few months finishing off.

She says she's glad that Katy's team were upfront about using her work.

In recent years, several music stars have faced allegations they have sampled other people's songs without permission.

Marvin Gaye's family successfully sued Robin Thicke over the 2015 single Blurred Lines - after claiming it copied the singer's 1977 hit Got to Give It Up.

While Ed Sheeran is facing a court battle in the US over allegations he copied parts of Marvin Gaye's Let's Get It On - which he denies.

Other artists including Bruno Mars, Mark Ronson, Madonna and Miley Cyrus have also been hit with legal claims.

Image copyright Getty Images Image caption Blurred Lines made more than $15m for Pharrell Williams (left) and Robin Thicke

"I think it's very good of Katy's team that they did it the right way," Dagny tells Newsbeat.

"I think it's a really positive thing because I don't think that any songwriter can deny the fact that when you go into sessions you're inspired by different things that you're listening to."

Dagny says it's not uncommon for her to listen to a bit of Katy Perry for inspiration before she starts writing or recording.

"There are endless times when I've been in the studio and we've started the session being like 'Let's put on some Katy Perry from 2012, Teenage Dream and all those massive songs she has, let's try and get a vibe from that'."

Image copyright Getty Images Image caption Dagny says she'll be spending the summer touring and playing at festivals

Love You Like That was written by Dagny, Swedish producer Jason Gill and songwriter Michelle Buzz in 2017.

The singer says she recorded the song on the final day of a two-month writing trip in Los Angeles where she'd "just done bad songs".

"We very quickly caught on this vibe of this one-note chorus and we just got really excited," she says.

"We started the session at 11 o'clock in the morning and I think we finished at four or five the next morning, just in one go.

"Then I literally went home. Grabbed my things and went back to Europe, three hours later."

'Part of something bigger'

Never Really Over was number 11 in the Official Singles Chart update on Monday and it looks like it could become a worldwide hit.

"You never know what can happen with a song that you've written," Dagny tells Newsbeat.

"It would be really sad, I think, to see this song blow up, realise how similar it is and not to be part of it.

"I was just kind of happy for the song that it could be part of something bigger."

Follow Newsbeat on Instagram, Facebook, Twitter and YouTube.

Listen to Newsbeat live at 12:45 and 17:45 every weekday on BBC Radio 1 and 1Xtra - if you miss us you can listen back here.