GalleryAlbums --Find if function "exists"

jerryh

Joined: 2013-02-04
Posts: 27
Posted: Thu, 2013-02-07 19:49

I'm looking through code of GalleryAlbumItem.
Is there a function to test if the album already exists?

I am doing an archiveupload... if the album already exists, I don't want it to create it again, just move on.

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2013-02-07 20:07

gallery would not know if it exists.
Gallery items are identified by id. Every album could have the same title and gallery would not care.

You would have to use gallery search interface to search for an album with the title or pathComponent you're trying to avoid.

Normally if gallery came upon a duplicate the new item would get renamed.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2013-02-07 20:26

thinking further, I'd just check for a pathCollision

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
jerryh

Joined: 2013-02-04
Posts: 27
Posted: Thu, 2013-02-07 21:26

out of curiousity, why would gallery want duplicate album names? I get that every album as a unique ID.
more curious behind the reasoning

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2013-02-07 22:00
Quote:
why would gallery want duplicate album names?

I never said that. I said gallery would not care.

Items cannot have duplicate ids or pathComponents

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
jerryh

Joined: 2013-02-04
Posts: 27
Posted: Thu, 2013-02-07 22:05

ok... Well I uploaded files and it created the album name c015
when it created the second one ...it created ->c015_001
I just figured that if it already existed, it would use it.

It was smart enough to add _001 to the name

 
suprsidr
suprsidr's picture

Joined: 2005-04-17
Posts: 8339
Posted: Thu, 2013-02-07 22:08

this is the default behavior, it you wanted to change it, then you would want to test the pathComponent.

Quote:
It was smart enough to add _001 to the name

As I said before this is a very mature application.

-s
________________________________
All New jQuery Minislideshow for G2/G3

 
jerryh

Joined: 2013-02-04
Posts: 27
Posted: Thu, 2013-02-07 22:47

thanks... Yes. As I am learning more about framework, I like it.

 
Dayo

Joined: 2005-11-04
Posts: 1642
Posted: Fri, 2013-02-08 10:28

You are not alone.

--
dakanji.com