solved jrCore_media_player on a Page

blindmime
@blindmime
11 years ago
772 posts
I'm trying something like this to put a player on a jrPage:
{jrCore_media_player type="jrAudio_player_dark" module="jrAudio" field="audio_file"  search="media._item.audio_credits = project-1" order_by="audio_file_track numerical_asc" limit="50" autoplay="false"}

I'd guess I'm getting the audio_credits field wrong. I want to have all the tracks with "project-1" in the credits to fill the player. They could have other things in the credits in addition to that.
updated by @blindmime: 09/07/14 02:48:56PM
paul
@paul
11 years ago
4,335 posts
Yeah, the search parameter looks wrong. Try -
search="audio_credits = project-1"


--
Paul Asher - JR Developer and System Import Specialist
blindmime
@blindmime
11 years ago
772 posts
That was my first choice. Not working.
paul
@paul
11 years ago
4,335 posts
Just read your original post again. Maybe there isn't an absolute "audio_credits = project-1"?
Try some wildcards - search="audio_credits = %project-1%"


--
Paul Asher - JR Developer and System Import Specialist
paul
@paul
11 years ago
4,335 posts
Sorry, that should be search="audio_credits LIKE %project-1%"


--
Paul Asher - JR Developer and System Import Specialist
blindmime
@blindmime
11 years ago
772 posts
Thanks so much!
blindmime
@blindmime
11 years ago
772 posts
Actually, we're almost there. I have search="audio_credits LIKE %project-`$item._item_id`%" as the search parameter, but it brings in items with "project-2" and "project-21".

How do I restrict to the specific project, remembering that the $audio_credits variable could be something like "composed by John Smith, source files by John Smith, Jane Doe for project-2."?
brian
@brian
11 years ago
10,149 posts
Don't add the ending '%' - that is a wildcard that means "0 or more of anything else". Instead do:

search="audio_credits like %project-`$item._item_id`"

Hope this helps!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
SteveX
SteveX
@ultrajam
11 years ago
2,587 posts
If you have a full stop at the end though, I think you'd need to allow for that. Something like:
search="audio_credits like %project-`$item._item_id`."



--
¯\_(ツ)_/¯ Education, learning resources, TEL, AR/VR/MR, CC licensed content, panoramas, interactive narrative, sectional modules (like jrDocs), lunch at Uni of Bristol. Get in touch if you share my current interests or can suggest better :)
blindmime
@blindmime
11 years ago
772 posts
Neither of these work quite right. The phrase won't always appear at the end, it could appear anywhere in the credits. Like "Created for project-1 using sources by John Smith and Jane Doe." Another song might have "Created for project-12 using sources by John Smith and Jane Doe." I don't want the expression returning both songs, Just specifically songs created for project-1 on project-1's page, and vice versa. jr4 produced the correct result by default, incidentally.
brian
@brian
11 years ago
10,149 posts
blindmime:
Neither of these work quite right. The phrase won't always appear at the end, it could appear anywhere in the credits. Like "Created for project-1 using sources by John Smith and Jane Doe." Another song might have "Created for project-12 using sources by John Smith and Jane Doe." I don't want the expression returning both songs, Just specifically songs created for project-1 on project-1's page, and vice versa. jr4 produced the correct result by default, incidentally.

Then I don't think you are reliable going to get this to work how you want. If this is for an aparna created module, I'd recommend a separate field that has a specific "tag" you can then search on. Trying to do a substring match on longer text is likely to leave wiggle room that will keep it from working perfectly every time.


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
blindmime
@blindmime
11 years ago
772 posts
It's the jrAudio module.

It seems like a common need would be search for something like "The Beatles" and not return both The Beatles and The Beatles Revue.

I'm probably wrong, but shouldn't search="audio_credits REGEXP ^project-`$item._item_id`$" work? I've tried escaping the $ in various ways. Maybe the jr syntax is doing something too?

Also, in my case, I can't really use an added field for this because a song could contain sources from multiple projects. The credit field is sometimes like, "Written by John Smith with sources from project-1 by Jane Doe, project-4 by Sam Smith, and project-24 by Don Juan." So I would have the same issue in that case. I'm using jrPage for artists to create Project Pages. the item_details template has a song player which automatically lists songs created with sources from the project based on the item_id which is the Project-id. A song might appear on multiple project pages if it uses sources from multiple projects.

I'm curious how jr4 worked in this regard. I've been doing this exact thing with jr4 for many years. Our site sort of revolves around listing songs that belong to certain numbered collaborative projects.

I've noticed the search in this forum and the documentation is sort of difficult to find things longer than a word, it seems. At least to me.
updated by @blindmime: 07/18/14 06:14:27AM
blindmime
@blindmime
11 years ago
772 posts
I think this appears to be working:

search="audio_credits REGEXP [[:<:]]project-`$item._item_id`[[:>:]]"

updated by @blindmime: 07/23/14 09:32:43PM

Tags