Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Reversing the order of the playlist #36

Open
@kaihendry

Description

I noticed your data structure has changed (my code that uses your library won't build) from 74b837a so that we have lists of AdaptionSets in lists of Periods IIUC.

I have legacy code like:

func reversempd(s []*mpd.Representation) []*mpd.Representation {
	for i, j := 0, len(s)-1; i < j; i, j = i+1, j-1 {
		s[i], s[j] = s[j], s[i]
	}
	return s
}
	if order == "desc" {
		for i, v := range m.Period.AdaptationSets {
			log.Println(i, v)
			v.Representations = reversempd(v.Representations)
			for j, r := range v.Representations {
				log.Println(j, r, "id", *r.ID)
			}
		}
	}

For reversing the order of the playlist which is needed for some reason or another. Can you suggest a way of realizing my reversal use case in light of the changes?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

        AltStyle によって変換されたページ (->オリジナル) /