solved Combined audio 'require image' code question

Ken Rich
Ken Rich
@ken-rich
9 years ago
926 posts
Here is the code that displays all songs, both uploaded and Soundclouds together.

<div class="block_content">
        {jrCombinedAudio_get_active_modules assign="mods"}
        {if strlen($mods) > 0}
            {jrSeamless_list modules=$mods order_by="_created random" pagebreak=10 page=$_post.p pager=true}
        {elseif jrUser_is_admin()}
            No active audio modules found!
        {/if}
    </div>

How do I get it to not show uploaded songs that have no picture?

If I add
require_image="audio_image"
it will not show Soundclouds.

I want to keep the Soundclouds, keep the unploaded songs with a picture, and "ONLY" eliminated uploaded songs that do not have a picture.




--

Ken Rich
indiegospel.net

updated by @ken-rich: 03/26/16 06:44:03AM
gary.moncrieff
gary.moncrieff
@garymoncrieff
9 years ago
865 posts
IIRC soundclound module links to an external image and is stored in something like soundcloud_artwork_url. The default avator shows if there is no image, this seems to be located at (Offsite URL Removed). If you scan your datastore you should see a url like that.
It's been some time since I have messed with audio stuff on Jamroom, so cant really tell you where to go from here.
Ken Rich
Ken Rich
@ken-rich
9 years ago
926 posts
Thanks Gary - I don't have a problem with Soundclouds, they all seem to have images.
However, many of my uploaded songs don't so it's those I would like to prune.
Have you seen my other question about putting songs in a folder for download. That's a functionality I really need badly, so am willing to pay for it.


--

Ken Rich
indiegospel.net
brian
@brian
9 years ago
10,148 posts
Ken Rich"]
However, many of my uploaded songs don't so it's those I would like to prune.

This may not be doable at this time with Seamless - the problem is that when you add something like:

require_image="audio_image"

That is going to be passed in to BOTH the call to SoundCloud AND Audio, which is why it keeps the SoundCloud items from showing.

I'm not sure of a good solution for this at this time, but is something we can check out.

Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
Ken Rich
Ken Rich
@ken-rich
9 years ago
926 posts
Hi Brian,

Well that's a bummer, my main audio page is kind of messed up.

Well I'm sure you guys will brainstorm up something. Meanwhile I am going to remove that page from the menu, and run with a separate Uploaded and Soundcloud page.


--

Ken Rich
indiegospel.net
paul
@paul
9 years ago
4,326 posts
Seamless can search for different fields in different modules - http://www.jamroom.net/the-jamroom-network/documentation/modules/289/seamless - so try something like -

{jrSeamless_list modules="jrAudio,jrSoundcloud" search="audio_image_size > 0,soundcloud_title LIKE %" . . . }

hth


--
Paul Asher - JR Developer and System Import Specialist
Ken Rich
Ken Rich
@ken-rich
9 years ago
926 posts
Hi Paul,

Thanks. I tried that on my development site and got this error.

{jrSeamless_list} inactive module specified (modules/jrCombinedAudio/templates/index.tpl)

I don't understand the error because that module is not deactivated.

If I put back the original code, the module works and I get my combined list (but with the missing images problem).

So I looked at the linked documentation you provided and tried a few tweaks to your code, but all I got was server errors with a blank screen.

I'm afraid I'm not much of a coder - lol


--

Ken Rich
indiegospel.net
michael
@michael
9 years ago
7,715 posts
What helps us out a lot is explaining the issue at each phase, then we can help with code.

What was the code you tried if it was just what paul pasted:
{jrSeamless_list modules="jrAudio,jrSoundcloud" search="audio_image_size > 0,soundcloud_title LIKE %" . . . }
that will fail because of those ....'s

DID THIS:
* ......
EXPECTED THIS:
* .....
GOT THIS:
* ......

Like your writing a test for kids in an exam that they have to figure out the answer to :)
Ken Rich
Ken Rich
@ken-rich
9 years ago
926 posts
Hi Michael,

I did it without the dots like this:

{jrSeamless_list modules="jrAudio,jrSoundcloud" search="audio_image_size > 0,soundcloud_title LIKE %"}

Also with page break:

{jrSeamless_list modules="jrAudio,jrSoundcloud" search="audio_image_size > 0,soundcloud_title LIKE %" pagebreak=10 page=$_post.p pager=true}

Also since there is a funny assign mods thingy in the original, I tried stripping that out of the division. So plunking Paul's code in the original was like this.

<div class="block_content">
        {jrCombinedAudio_get_active_modules assign="mods"}
        {if strlen($mods) > 0}{jrSeamless_list modules="jrAudio,jrSoundcloud" search="audio_image_size > 0,soundcloud_title LIKE %" pagebreak=10 page=$_post.p pager=true}
{elseif jrUser_is_admin()}
            No active audio modules found!
        {/if}
    </div>
          

Since that wasn't working i tried this:


<div class="block_content">
       {jrSeamless_list modules="jrAudio,jrSoundcloud" search="audio_image_size > 0,soundcloud_title LIKE %" pagebreak=10 page=$_post.p pager=true}
    </div>
          

Then I tried some ad hoc stuff just guessing from the supplied documentation, but got no where.

I just don't know enough to make educated guesses as to what will work.


--

Ken Rich
indiegospel.net
michael
@michael
9 years ago
7,715 posts
Educated guesses are a good first thing to try, but when they fail, then you need to go step by step and understand the problem.

So back to
{jrSeamless_list modules="jrAudio,jrSoundcloud"}
Q: does it work? yes = continue, no = try simpler.

I'll your above examples here and see what I get.
michael
@michael
9 years ago
7,715 posts
The problem is 'jrSoundcloud' there is no module by that name, so you get the error:
{jrSeamless_list} inactive module specified

The 'c' needs to be a capital to match the modules name.
<div class="block_content">
       {jrSeamless_list modules="jrAudio,jrSoundCloud" search="audio_image_size > 0,soundcloud_title LIKE %" pagebreak=10 page=$_post.p pager=true}
    </div>
Ken Rich
Ken Rich
@ken-rich
9 years ago
926 posts
Ok - the error is gone but it's not showing any soundclouds, just uploaded songs.

I assume because there is something wrong with the search criteria???


--

Ken Rich
indiegospel.net
michael
@michael
9 years ago
7,715 posts
Try things. Docs for seamless:
Docs: "Seamless"
https://www.jamroom.net/the-jamroom-network/documentation/modules/289/seamless

Docs: "{jrCore_list}"
http://www.jamroom.net/the-jamroom-network/documentation/development/89/jrcore-list

Then come back and let me know what works, what doesn't what you tried and where your stuck. Happy to help when stuck, but don't really want to be the solution instead of trying, or developer on call. ;)

Try:
search1="audio_image_size > 0" search2="soundcloud_title LIKE %"
http://www.jamroom.net/the-jamroom-network/documentation/development/89/jrcore-list#search-conditions

search="audio_image_size > 0 || soundcloud_title LIKE %"
http://www.jamroom.net/the-jamroom-network/documentation/development/89/jrcore-list#searching-with-or
Ken Rich
Ken Rich
@ken-rich
9 years ago
926 posts
Thanks Michael,

Will give it a try when time permits - last minute shopping today - Merry Christmas.


--

Ken Rich
indiegospel.net
Ken Rich
Ken Rich
@ken-rich
9 years ago
926 posts
Hi Michael,

Success!!! The first search string gave a white page, but the second one worked.

I have 170 pages of uploaded songs (with pictures), mixed with 12 pages of Soundlouds, for a total of 1,820 songs with pictures displayed.

145 pages, or 1,450 uploaded songs (with no pictures) are being screened out.

This is my working code:

 <div class="block_content">
       {jrSeamless_list modules="jrAudio,jrSoundCloud" search="audio_image_size > 0 || soundcloud_title LIKE %" order_by="audio_title random" pagebreak=10 page=$_post.p pager=true}
    </div>



--

Ken Rich
indiegospel.net
michael
@michael
9 years ago
7,715 posts
Well done, glad you got it sorted. :)