Skip to content
This repository has been archived by the owner on Feb 10, 2022. It is now read-only.

Commit

Permalink
Add track_dup()
Browse files Browse the repository at this point in the history
Clients might find it useful.

Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com>
  • Loading branch information
felipec committed Jan 2, 2010
1 parent 9b1f460 commit 34c23fa
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 0 deletions.
17 changes: 17 additions & 0 deletions scrobble.c
Expand Up @@ -102,6 +102,23 @@ sr_track_free(sr_track_t *t)
free(t);
}

sr_track_t *
sr_track_dup(sr_track_t *in)
{
sr_track_t *t;
t = sr_track_new();
t->artist = g_strdup(in->artist);
t->title = g_strdup(in->title);
t->timestamp = in->timestamp;
t->source = in->source;
t->rating = in->rating;
t->length = in->length;
t->album = g_strdup(in->album);
t->position = in->position;
t->mbid = g_strdup(in->mbid);
return t;
}

static inline void
check_last(sr_session_t *s,
int timestamp)
Expand Down
1 change: 1 addition & 0 deletions scrobble.h
Expand Up @@ -39,6 +39,7 @@ void sr_session_test(sr_session_t *s);

sr_track_t *sr_track_new(void);
void sr_track_free(sr_track_t *t);
sr_track_t *sr_track_dup(sr_track_t *in);

void sr_session_handshake(sr_session_t *s);
void sr_session_submit(sr_session_t *s);
Expand Down

0 comments on commit 34c23fa

Please sign in to comment.