This question is answered.


Permlink Replies: 4 - Pages: 1 - Last Post: 8 Oct 20, 22:43 Last Post By: RobM Threads: [ Previous | Next ]
RobM

Posts: 3,787
Registered: 4-Aug-2006
Unable to access comments from an instance of a video object
Posted: 8 Oct 20, 18:18
 
  Click to reply to this thread Reply
As in the title, can't access the comment from a new instance of a video, it returns a null instead of the comment.

The attached zipped project has a few images and a video, made from those images.

Load the project and then in the System console paste and evaluate this code
Work.on(rootFolder.descendants).forEach(ao) -> {
System.out.println("ao title=" + ao.getTitle())
System.out.println("ao comment=" + ao.getComment())
System.out.println("ao keywords=" + ao.getKeywords())
aof = ao.getFile()
AlbumObject aoInstance = ao.getFactory().createInstance(aof)
System.out.println("ao instance title=" + aoInstance.getTitle())
System.out.println("ao instance comment=" + aoInstance.getComment())
System.out.println("ao instance keywords=" + aoInstance.getKeywords())
}

The output for an image and the video is
ao title=Clock
ao comment=Knocking off time
ao keywords=Clock [Clock] ock
ao instance title=Clock
ao instance comment=Knocking off time
ao instance keywords=Clock [Clock] ock
ao title=Slideshow
ao comment=Video of the slides
ao keywords=video, slideshow
ao instance title=Slideshow
ao instance comment=null
ao instance keywords=video, slideshow
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Unable to access comments from an instance of a video object
Posted: 8 Oct 20, 20:09   in response to: RobM in response to: RobM
 
  Click to reply to this thread Reply
Use the version of createInstance that takes an AlbumObject as parent. That should resolve this.
RobM

Posts: 3,787
Registered: 4-Aug-2006
Re: Unable to access comments from an instance of a video object
Posted: 8 Oct 20, 20:16   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
Use the version of createInstance that takes an AlbumObject as parent. That should resolve this.
What do I use as the parent, is it the folder the video is in?
davidekholm

Posts: 3,442
Registered: 18-Oct-2002
Re: Unable to access comments from an instance of a video object
Posted: 8 Oct 20, 20:19   in response to: RobM in response to: RobM
Correct
  Click to reply to this thread Reply
RobM wrote:
davidekholm wrote:
Use the version of createInstance that takes an AlbumObject as parent. That should resolve this.
What do I use as the parent, is it the folder the video is in?

Either that or whatever folder you wish to be the logical parent of this video. jAlbum will put the generated comments.properties file in the .jalbum folder of the designated parent folder.
RobM

Posts: 3,787
Registered: 4-Aug-2006
Re: Unable to access comments from an instance of a video object
Posted: 8 Oct 20, 22:43   in response to: davidekholm in response to: davidekholm
 
  Click to reply to this thread Reply
davidekholm wrote:
RobM wrote:
davidekholm wrote:
Use the version of createInstance that takes an AlbumObject as parent. That should resolve this.
What do I use as the parent, is it the folder the video is in?

Either that or whatever folder you wish to be the logical parent of this video. jAlbum will put the generated comments.properties file in the .jalbum folder of the designated parent folder.

Thanks, that fixed it. The video from images tool, once uploaded again, should work on Windows machines that lock files when an application is referencing them.
Legend
Forum admins
Helpful Answer
Correct Answer

Point your RSS reader here for a feed of the latest messages in all forums