Author Topic: Disable flickr?  (Read 14083 times)

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Disable flickr?
« Reply #15 on: January 27, 2008, 12:03:29 pm »
I have renamed the script and killed the process (and subsequently rebooted), added my own pictures and set the attributes using the new feature. And deleted the Flickr files that it had already downloaded.

Unfortunately, before I thought it through, I just deleted the Flickr photos and directories with a sudo rm command...

Then subsequently realised that this wasn't going to clear out the database - no matter, I thought I would just resync. Did that successfully, but it seems that this won't delete it from the database. When I use the file sync section and browse the folders for my pics, it has "Screensaver for MD: *" next to each of them. When I click on the "*" it takes me to the list of all pics marked with the screensaver attribute, and it still lists hundreds of Flickr photos, albeit with "!" next to their name. I could delete them manually, but this would take hours as there are about 14 pages of them and you can't multiple select!

How can I clean up the database given that resync doesn't do it? I have tried to recreate the flickr folder, resync, and then delete it again using the web site, but this doesn't seem to reconnect with the database and clean it up....

Any advice?

RichardP

  • Veteran
  • ***
  • Posts: 131
    • View Profile
Re: Disable flickr?
« Reply #16 on: January 27, 2008, 12:35:02 pm »
I have renamed the script and killed the process (and subsequently rebooted), added my own pictures and set the attributes using the new feature. And deleted the Flickr files that it had already downloaded.

Unfortunately, before I thought it through, I just deleted the Flickr photos and directories with a sudo rm command...

Then subsequently realised that this wasn't going to clear out the database - no matter, I thought I would just resync. Did that successfully, but it seems that this won't delete it from the database. When I use the file sync section and browse the folders for my pics, it has "Screensaver for MD: *" next to each of them. When I click on the "*" it takes me to the list of all pics marked with the screensaver attribute, and it still lists hundreds of Flickr photos, albeit with "!" next to their name. I could delete them manually, but this would take hours as there are about 14 pages of them and you can't multiple select!

How can I clean up the database given that resync doesn't do it? I have tried to recreate the flickr folder, resync, and then delete it again using the web site, but this doesn't seem to reconnect with the database and clean it up....

Any advice?

I had the same issue this morning. Does anyone have any suggestions? If not, I'll see if I can write a script that will remove all pictures out of the database that are not on the disk.

Best Regards,
Richard

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Disable flickr?
« Reply #17 on: January 27, 2008, 09:46:29 pm »
Richard - the other thing is, has anybody noticed that the playback of the images you add isn't random (don't know if this was true for the Flickr stuff as well) it seems to get stuck on 2 images and goes back and forth between them up to 7 or 8 times, then suddenly seems to find another 2 and moves on... I don't quite get what is going on but I'm sure that's not how it was intended. Unless it is a side effect of having a large number of Flickr images in the database, still, that no longer exist on disk...

RichardP

  • Veteran
  • ***
  • Posts: 131
    • View Profile
Re: Disable flickr?
« Reply #18 on: January 28, 2008, 03:45:48 am »
Richard - the other thing is, has anybody noticed that the playback of the images you add isn't random (don't know if this was true for the Flickr stuff as well) it seems to get stuck on 2 images and goes back and forth between them up to 7 or 8 times, then suddenly seems to find another 2 and moves on... I don't quite get what is going on but I'm sure that's not how it was intended. Unless it is a side effect of having a large number of Flickr images in the database, still, that no longer exist on disk...

Curious. I did notice that, but didn't think anything of it, because I was fiddling so much. I might poke around under the hood, although I'll have to find where that is first...
Best Regards,
Richard

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Disable flickr?
« Reply #19 on: January 28, 2008, 06:35:13 pm »
Tried ticking the "Show files who are missing from disk" box in the webadmin's Media Files Sync screen?   They should have a "Delete from Database" button.
"Change is inevitable. Progress is optional."
-- Anonymous


RichardP

  • Veteran
  • ***
  • Posts: 131
    • View Profile
Re: Disable flickr?
« Reply #20 on: January 28, 2008, 11:08:10 pm »
Tried ticking the "Show files who are missing from disk" box in the webadmin's Media Files Sync screen?   They should have a "Delete from Database" button.

They do, and it works. But it's very tedious doing it one by one. We definately need a delete all or some such.
Best Regards,
Richard

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Disable flickr?
« Reply #21 on: January 29, 2008, 02:01:27 am »
Tried ticking the "Show files who are missing from disk" box in the webadmin's Media Files Sync screen?   They should have a "Delete from Database" button.

They do, and it works. But it's very tedious doing it one by one. We definately need a delete all or some such.

Richard - I agree, that would be much better (I have about 200 to delete!), but did you end up making any progress on scripting it?

Actually - Zaerc is right, I can choose that option and delete the whole Flickr folder, with the files presumably as children in the database, this cleaned those out as well! I had to resync my own pictures for some reason, but all OK.

RichardP

  • Veteran
  • ***
  • Posts: 131
    • View Profile
Re: Disable flickr?
« Reply #22 on: January 29, 2008, 05:39:26 am »

Richard - I agree, that would be much better (I have about 200 to delete!), but did you end up making any progress on scripting it?

Actually - Zaerc is right, I can choose that option and delete the whole Flickr folder, with the files presumably as children in the database, this cleaned those out as well! I had to resync my own pictures for some reason, but all OK.

I missed that - I was deleting the entries one by one, rather than the entire directory. I'll try it when I get home.

Sorry, Colin, havn't even looked at the script yet. I was out most of the weekend - had out of state visitors.

Zaerc - could you point me toward the webpage and/or PHP file that shows the files which are in the DB but not in the filesystem. I'll take a look at that as the starting point for the script, and also have so I can have a look at whether or not I feel competent enough to attempt to place a "DeleteAll" button on the webpage.

Best Regards,
Richard.
Best Regards,
Richard

totallymaxed

  • LinuxMCE God
  • ****
  • Posts: 4660
  • Smart Home Consulting
    • View Profile
    • Dianemo - at home with technology
Re: Disable flickr?
« Reply #23 on: January 29, 2008, 12:20:40 pm »

Richard - I agree, that would be much better (I have about 200 to delete!), but did you end up making any progress on scripting it?

Actually - Zaerc is right, I can choose that option and delete the whole Flickr folder, with the files presumably as children in the database, this cleaned those out as well! I had to resync my own pictures for some reason, but all OK.

I missed that - I was deleting the entries one by one, rather than the entire directory. I'll try it when I get home.

Sorry, Colin, havn't even looked at the script yet. I was out most of the weekend - had out of state visitors.

Zaerc - could you point me toward the webpage and/or PHP file that shows the files which are in the DB but not in the filesystem. I'll take a look at that as the starting point for the script, and also have so I can have a look at whether or not I feel competent enough to attempt to place a "DeleteAll" button on the webpage.

Best Regards,
Richard.

Richard,

Go to Web Admin -> Files & Media -> Media Files Sync

Now look at the bottom of the righthand frame and you will see a "Show files who are missing from disk" check-box... just click it to show the missing from disk files as you browse.

Andrew
Andy Herron,
CHT Ltd

For Dianemo/LinuxMCE consulting advice;
@herron on Twitter, totallymaxed+inquiries@gmail.com via email or PM me here.

Get Dianemo-Rpi2 ARM Licenses http://forum.linuxmce.org/index.php?topic=14026.0

Get RaspSqueeze-CEC or Raspbmc-CEC for Dianemo/LinuxMCE: http://wp.me/P4KgIc-5P

Facebook: https://www.facebook.com/pages/Dianemo-Home-Automation/226019387454465

http://www.dianemo.co.uk

Zaerc

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 2256
  • Department of Redundancy Department.
    • View Profile
Re: Disable flickr?
« Reply #24 on: January 29, 2008, 09:19:35 pm »
...
Zaerc - could you point me toward the webpage and/or PHP file that shows the files which are in the DB but not in the filesystem. I'll take a look at that as the starting point for the script, and also have so I can have a look at whether or not I feel competent enough to attempt to place a "DeleteAll" button on the webpage.
...

I would if I could, but I'm not that familiar with the webadmin site.
"Change is inevitable. Progress is optional."
-- Anonymous


RichardP

  • Veteran
  • ***
  • Posts: 131
    • View Profile
Re: Disable flickr?
« Reply #25 on: January 31, 2008, 02:32:58 am »
They do, and it works. But it's very tedious doing it one by one. We definately need a delete all or some such.

I've made some progress with placing a button on the webpage. When you click it, it will (hopefully) delete all the files from the current directory which are in the DB, but not on disk.

Is anyone willing to test it? I need to verify that on other systems besides mine, it does not remove from the database any files which exist on the disk, and that it does not have any other unexpected side-effect.

Installation will be a matter of replacing two files on the core (you can save the original ones first, in case you need to go back to the original).

I should have it ready to distribute this evening (morning of the 1st for the British and Americans).
Best Regards,
Richard.

Best Regards,
Richard

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Disable flickr?
« Reply #26 on: January 31, 2008, 12:32:22 pm »
Richard - so you are saying this isn't an explicit delete of particular files, but checks if a set of files in a directory actually exist on the disk and deletes them from the db if they don't? So in other words a "clean up" function?

How does it determine if the files are on disk or simply not available if that disk isn't around at the time (disconnected from the network, or simply network issues like I am having at the moment!) Does it distinguish between files that come back as not there, and files that come back as "device offline"?

RichardP

  • Veteran
  • ***
  • Posts: 131
    • View Profile
Re: Disable flickr?
« Reply #27 on: February 05, 2008, 02:56:01 am »
Richard - so you are saying this isn't an explicit delete of particular files, but checks if a set of files in a directory actually exist on the disk and deletes them from the db if they don't? So in other words a "clean up" function?

How does it determine if the files are on disk or simply not available if that disk isn't around at the time (disconnected from the network, or simply network issues like I am having at the moment!) Does it distinguish between files that come back as not there, and files that come back as "device offline"?

At the moment, it doesn't verify the files exist on the disk - but read on.

What it does is delete all the files from the DB that are in the list of files missing from the disk. (This may sound confusing until you look at the screen). This list is originally created (when you open the page or refresh it), by querying the DB with a SQL statement which obtains all the files in the current directory which are marked (in the DB) as missing AND which do not exist on disk.

So the upshot of it all is you would open the page and down the bottom you would see a list of missing files, and a button which offers to delete all of them. If the files are missing because the storage device is offline, you would know it and not use the button, I guess. Alternatively you could bring the device online, re-sync the directory, then hit the delete-all button to delete files which truly are missing from device.

Does this sound plausible, or am I misreading the code?

Colin, if you have storage devices that are sometimes offline, I'd really appreciate your testing the new page.

Best Regards,
Richard.

Best Regards,
Richard

colinjones

  • Alumni
  • LinuxMCE God
  • *
  • Posts: 3003
    • View Profile
Re: Disable flickr?
« Reply #28 on: February 05, 2008, 12:24:13 pm »
You might see in other threads that I have been suffering from my network media being permanently offline! Couldn't bring it online over many builds.

I found a workaround today - finally, and have demonstrated that there is definitely an error of logic (or straight bug) in the LMCE code for detecting if network media is online or not. I have only just got my media online properly for the first time since buying all this hardware over 4 weeks ago, so you'll forgive me if I play with it for a while before starting to screw with my database :) maybe just before I start rebuild 10! In any case, I have MANY other issues to deal with that have languished as lower relative priorities as a result of this one, so I better get cracking on those now!

Will respond to your PM on USBIRT tomorrow.

Col.